Update NoIP Host with c#

More about NoIP dynamic dns update request click here.

private void UpdateNoIPHost()
{
	try
	{
		HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
			string.Format("http://dynupdate.no-ip.com/nic/update?hostname={0}", "<NoIP Hostname>"));
		request.Method = "GET";
		request.Proxy = null;
		request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64)";
		request.Timeout = 10000;
		request.Headers.Add(HttpRequestHeader.Authorization, string.Format("Basic {0}",
			Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}",
			"<NoIP username>", "<NoIP password>")))));
 
		using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
		{
		}
	}
	catch
	{
	}
}
Categories: C# Tags: , , ,
%d bloggers like this: