Getting your dynamic public IP in C# & .net
This code makes a HTTP request to network-tools.com and retrieves the IP from the response.
string URL = "http://www.network-tools.com";
HttpWebRequest HWR = (HttpWebRequest)HttpWebRequest.Create(URL);
HWR.Method = "GET";
StreamReader SR = new StreamReader(HWR.GetResponse().GetResponseStream());
string Response = SR.ReadToEnd();
string Pattern = @"dd?d?.dd?d?.dd?d?.dd?d?";
Regex R = new Regex(Pattern, RegexOptions.Singleline | RegexOptions.IgnoreCase);
Match M = R.Match(Response);
string IP = M.ToString();
HttpWebRequest and HttpWebResponse are two very useful classes in .NET. I will recommened reading up on this and I will soon blog about them again.
- Draw graphs using OpenCV
- ARM’s 64-bit mode (AArch64) ARMv8)
- How to detect the color of a person’s shirt
- To RAID or not to RAID
- Rotating or Resizing an Image in OpenCV
- Hardware Platforms for Embedded Computer Vision, Image Processing and Deep Learning
- Scripting form post in C# & .net
- Who is WHOIS?
- Mixing Assembly language with Visual Basic
- Fiddling with Fiddler