I am trying to update my ip address on no-ip.com using the call they specify as per their page here http://www.noip.com/integrate/request
So far I tried
Dim webAddress As String = "http://username:password@dynupdate.no-ip.com/nic/update?hostname=mytest.testdomain.com&myip=1.2.3.4"
Process.Start(webAddress)
This gives error Additional information: The system cannot find the file specified
I tried this
Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://username:password@dynupdate.no-ip.com/nic/update?hostname=mytest.testdomain.com&myip=1.2.3.4")
Dim resp As System.Net.WebResponse = req.GetResponse
Str = resp.GetResponseStream
It gives error Additional information: Invalid URI: Invalid port specified.
And also tried using a WebBrowser with
WebBrowser1.navigate("http://username:password@dynupdate.no-ip.com/nic/update?hostname=mytest.testdomain.com&myip=1.2.3.4")
It give error Additional information: Value does not fall within the expected range.
I think it might be related to these controls don't like how is the link is formated
BTW, I don't want to use no-ip own client ip updater, and of course I changed the details on the link :) When I copy and paste the link in Chrome it works fine and changes the ip as expected
Update This works fine now
Dim username As String = HttpUtility.UrlEncode("XXX@XXX.XXX")
Dim password As String = HttpUtility.UrlEncode("XXX")
Dim query As String = String.Format("http://{0}:{1}@dynupdate.no-ip.com/nic/update?hostname=XXXXXX.ddns.net&myip=" & TextBox2.Text, username, password)
Process.Start(query)
But ideally I would like to handle the request and the response in code without opening a browse (I only tried this to check why I am getting an error, but it is not the ideal solution)
When I try this
WebBrowser1.Navigate(query)
It works fine, and it is good for now, but still getting error when using this code which I would love to use.
Dim req As System.Net.WebRequest = System.Net.WebRequest.Create(query)
Dim resp As System.Net.WebResponse = req.GetResponse
Str = resp.GetResponseStream
This time I am getting error 401 Unauthorised