Hi,
i want to write a .net class that can update my ip address at the dyndns
service (http://www.dyndns.org).
When I open the page
I get the response
I wrote this code in my c# class:
I get the following error on the line
What is the difference between the browser and my code? Any ideas?
Tia
André Heuer
i want to write a .net class that can update my ip address at the dyndns
service (http://www.dyndns.org).
When I open the page
https://username:passwo rd@members.dynd ns.org/nic/update?system=d yndns&hostname= MyHostNameHere& myip=MyCurrentI pHere&wildcard= on
I get the response
nochg 80.146.122.175
which means "No change". IP hasn´t changed. Fine.I wrote this code in my c# class:
Code:
public void UpdateIP(IPAddress ip) { const string UPDATE_URL = "https://<USER>:<PWD>@members.dyndns.org/nic/update?system=dyndns&hostname=< HOST>&myip=<IP>&wildcard=<WILDCARD>"; string url = UPDATE_URL; url = url.Replace("<USER>", mUsername); url = url.Replace("<PWD>", mPassword); url = url.Replace("<HOST>", mDomain); url = url.Replace("<IP>", ip.ToString()); url = url.Replace("<WILDCARD>", mWildcard ? "on" : "off"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Headers.Add("Cache-control", "no-cache"); request.Headers.Add("Pragma","no-cache"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string text = new StreamReader(response.GetResponseStream()).ReadToEnd(); }
Code:
"HttpWebResponse response = (HttpWebResponse)request.GetResponse();": 'System.Net.WebException' in system.dll Remote Server returned an error (403) Unzulässig.
Tia
André Heuer
Comment