|
-
Jul 14th, 2003, 02:56 PM
#1
Thread Starter
Hyperactive Member
HTTP, HTTPS, UNC - textbox prefix
Hi,
I have a textbox that I want to found out if the data entered into it starts off with certain text i.e.
if the user typed in "http://myserver/sharedname" as the path for the file, i want to be able to tell if it's a web addres...
the way i'm trying to do it to cut down on code rather than parsing through the string is to...
Select Case txtNetPath.Text.ToString
Case strPrefix.StartsWith("http://") = true
MsgBox("http://")
Case strPrefix.StartsWith("https://") = true
MsgBox("https://")
End Select
this select case doesn't work, yet an if then does.... I rather use the select case since it is easier to look at and faster? thanks.
-
Jul 14th, 2003, 03:16 PM
#2
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strHtml As String = TextBox1.Text
If Not Len(strHtml) < 7 Then
Select Case strHtml.Substring(0, 7)
Case "http://"
MessageBox.Show("i'm a [url]http://[/url] link !")
Case "https:/"
MessageBox.Show("i'm a [url]https://[/url] link !")
End Select
End If
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|