Hey Guys,
I have coded a small application to format URLs using the code:
When importing the URLs everything works fine until it hits a url that starts with: www
site.com <-- this imports fine i can add the "http://"
www.site.com <-- this one throws an error [Invalid URI the hostname could not be parsed]
i tried to compensate for it above but it doesn't seem to work, i'm not sure what i have done wrong.
any help would be appreciated :)
thanks guys
Graham
I have coded a small application to format URLs using the code:
Code:
'// First split the HOST/USERNAME/PASSWORD
Dim stringArray As String() = strAccount.Split(" ")
Dim stringURI As String
Dim stringUser As String
Dim stringPass As String
Dim newURL As String
stringURI = stringArray(0)
stringUser = stringArray(1)
stringPass = stringArray(2)
'// Check if the string URL contains "http://" if not add it...
If (stringURI.Contains("http://")) Or stringURI.Contains("https://") Then
stringURI = stringArray(0)
Else
stringURI = "http://" & stringArray(0)
End If
If stringURI.StartsWith("www") Then
stringURI = "http://" & stringArray(0)
End If
site.com <-- this imports fine i can add the "http://"
www.site.com <-- this one throws an error [Invalid URI the hostname could not be parsed]
i tried to compensate for it above but it doesn't seem to work, i'm not sure what i have done wrong.
any help would be appreciated :)
thanks guys
Graham