Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY!

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 21.04.2006, 06:03   #12
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

well.. it doesnt work :S
same problem persist...

this is my code...

// Send the request and hopefully we'll get response.
// Try to parse out the IP address from the returned HTML
try
{
//http://dynupdate.no-ip.com/ip.php
//http://www.whatismyip.com
//http://www.getmyipaddress.com
//http://checkip.dyndns.org
//http://ripper.net.ar/ip.php
WebRequest myRequest = WebRequest.Create("http://ripper.net.ar/ip.php");
myRequest.Timeout = 320000;

// Send request, get response, and parse out the IP address on the page.
//HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
using (WebResponse res = myRequest.GetResponse())
{
using (Stream s = res.GetResponseStream())
using (StreamReader sr = new StreamReader(s, Encoding.UTF8))
{
string html = sr.ReadToEnd();
Regex regex = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
string ipString = regex.Match(html).Value;

return ipString;
}
}
}
catch (Exception ex)
{
string a = ex.Message;
return "<Unable to resolve>";
}
Digital is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:58.