|
#1
|
||||
|
||||
NOT CODED BY ME!
Code:
using System;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
namespace DreamInCode.Snippets
{
****public class IpFinder
****{
********public static IPAddress GetExternalIP()
********{
************string whatIsMyIp = "http://whatismyip.com";
************string getIpRegex = @"(?<=<TITLE>.*)\d*\.\d*\.\d*\.\d*(?=</TITLE>)";
************WebClient wc = new WebClient();
************UTF8Encoding utf8 = new UTF8Encoding();
************string requestHtml = "";
************try
************{
****************requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
************}
************catch (WebException we)
************{
****************// do something with exception
****************Console.Write(we.ToString());
************}
************Regex r = new Regex(getIpRegex);
************Match m = r.Match(requestHtml);
************IPAddress externalIP = null;
************if (m.Success)
************{
****************externalIP = IPAddress.Parse(m.Value);
************}
************return externalIP;
********}
****}
}
and add reps if u like my post▌▌ |
| The Following User Says Thank You to baadshahdon For This Useful Post: | ||
-=DesiClassics=- (06-18-2008) | ||
|
#2
|
|||
|
|||
too old stuff
btw those who dont have it is nice one for them |
|
#3
|
||||
|
||||
ya dude old stuff
|
|
#4
|
||||
|
||||
hmmmmm
|
|
#5
|
||||
|
||||
tfs
|







and add reps if u like my post▌▌![Send a message via MSN to -=[Rohit]=-](http://dctorrent.com/images/fun/misc/im_msn.gif)





