|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Dec 2005
Location: Missouri , USA
Age: 38
Posts: 256
|
Hello. I jsut switched from Cable to DSL, And the issue is i cannout use UOG to connect from my computers on the network, Only way i can connect on the server is using new local server and the local ip, however that will not work on any of the other computers, i use Mr. Fixits and have tried the stock serverlist.cs, I have tried difrent routers and no router same thing,, anyone have ideas how to get around this?
thanks |
|
|
|
|
|
#2 (permalink) | |
|
Account Terminated
|
Quote:
Your modem also might be itself a router, contact your provider if you don't know what kind of hardware it is. |
|
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
Join Date: Dec 2005
Location: Missouri , USA
Age: 38
Posts: 256
|
its not port forwarding * hell if it was that easy*
Other people can get in just fine i think it may be the NAT im not sure ill keep messing with it, it goes to the server list but then when you click on the server it gives that client cannot attach thing i see the connection on the server with valid credentials, then it disconnects and gives the client cannot attach thing |
|
|
|
|
|
#5 (permalink) | ||
|
Account Terminated
|
Quote:
Quote:
Like jack_sisco, who is rude to post in your thread, its a serverlist.cs issue post it. |
||
|
|
|
|
|
#6 (permalink) |
|
Newbie
Join Date: Jan 2006
Posts: 20
|
I have a very similar problem (if not the same one) so I might as well post it here.
I first encountered the problem way back when, at the time I was using runuo 1.0. Basicly you set the server up on its own computer on a home network, forward the ports in the modems NAT, set you IP/DNS in the ServerList.cs and as expected players can connect to your server... Unless they happen to be on the same home network as the computer the servers runing on. Basicly anyone connecting with an internal IP connects, the account credentials are verified and confirmed, the get sent to the shard list and then you have problems, as soon they select the shard the server disconects them and they get the "game client could not attach to server" message. Eventualy I got Mr Fixit's server list script and that completely resolved the issue. Fast forward to now. I've updated to runuo 2.0. The Mr Fixit server list script I was using doesn't work. The stock server list script that comes with runuo 2.0 works fine for people external to the network and they can connect and play fine (and are reporting a reduction in lag which is encouraging). However, once again computers on the internal network get disconnected when selecting the shard. Tried getting the latest version of the Mr Fixit's server list script I could find, which was 2.2 found here: ServerList.cs 2.2 but to no avail. Only thing I currently have changed in the script linked is the name of shard 1. Doesn't matter if I enter my external IP, DNS or leave it as null and let it autodetect the IP as I've currently left it, players outside my network can connect fine but still no love for players inside the home network. Everythings patched up on both the server and other computers on the network (UO client patch 5.0.2g, Windows XP SP2 fully updated with dotnetframework 2.0.50727 etc.) and there are no firewalls causing any problems so I'm at a loss. Any suggestions? |
|
|
|
|
|
#8 (permalink) |
|
Forum Expert
|
Here is my (Mr Fixit) Serverlist.cs I know it works with 2.0. You may have an altered version that supports multiple servers that was released a few months back- if I remember correctly, the scripter said it wouldn't work unless you had multiple servers, but I'm going off memory here. Anyway, you'll need to change the shard name and the port back to 2593. If this doesn't fix your problems, I don't know what the problem is- sorry
![]()
__________________
Buy this stuff.
|
|
|
|
|
|
#10 (permalink) |
|
Forum Expert
|
I believe that was a problem with 1.0 as well, which is why everyone here is always reccomending Mr Fixit's Serverlist.cs
*Edit* I think I misunderstood your post at first... you could use WinMerge to compare the 2 files if you are super curious.
__________________
Buy this stuff.
Last edited by Aeolus; 08-06-2006 at 11:59 PM. |
|
|
|
|
|
#11 (permalink) |
|
Lurker
Join Date: Jun 2006
Posts: 7
|
i have 2.0 mrfixits serverlist.cs and half the time people can connect and the other half i have to restart several time before they can connect! i found a warning when i had an error on another sctipts + Misc/ServerList/ServerList/ServerList.cs:
CS0618: Line 343: 'System.Net.Dns.Resolve(string)' is obsolete: 'Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.co m/fwlink/?linkid=14202' and here,s my serverlist.cs using System; using System.Net; using System.Net.Sockets; using Server; using Server.Network; namespace Server.Misc { public class ServerList { // ================================================== ================================ // YOUR SERVERS NAME // ================================================== ================================ public const string ServerName = "_ _ _ _ _ _ _ _"; // ================================================== ================================ // YOUR INTERNET IP OR DNS NAME // Here you can select to autodetect your internet ip, or manualy specify // Examples: // public static string Address = "12.34.56.78"; // public static string Address = "shard.host.com"; // ================================================== ================================ public const bool InternetIPAutodetect = true; public const int MinutesBetweenIPAutodetect = 1440; public static string Address = null; // ================================================== ================================ // Here are some values stored // ================================================== ================================ private static LocalLanIPRange[] LocalLanIPRanges = new LocalLanIPRange[10]; private static UInt32 LocalLanIPRangesCount; private static AutoIPMirror[] AutoIPMirrors = new AutoIPMirror[10]; private static UInt32 AutoIPMirrorsCount; private static DateTime InternetIPAutodetectLast; // ================================================== ================================ // Initialization // ================================================== ================================ public static void Initialize() { // ---------------------------------------------------- // Select what port to use // ---------------------------------------------------- Listener.Port = 2593; // ---------------------------------------------------- // Load the local LAN ip ranges // ---------------------------------------------------- AddLocalLANIPRange("10.0.0.0", "10.255.255.255"); AddLocalLANIPRange("192.168.0.0", "192.168.255.255"); AddLocalLANIPRange("172.16.0.0", "172.32.255.255"); AddLocalLANIPRange("169.254.0.0", "169.254.255.255"); // ---------------------------------------------------- // Load the Auto IP mirros // ---------------------------------------------------- AddAutoIPMirror("http://www.findmyip.com/", "Your IP address is:<br>", "</FONT>"); AddAutoIPMirror("http://www.ipaddy.com/", "Your IP address is: ", "<br>"); AddAutoIPMirror("http://checkip.dyndns.org/", "Current IP Address: ", "</body>"); AddAutoIPMirror("http://ipid.shat.net/iponly/", "<title>", "</title>"); AddAutoIPMirror("http://www.edpsciences.com/htbin/ipaddress", "Your IP address is <B> ", " </B>"); AddAutoIPMirror("http://www2.simflex.com/ip.shtml", "Your IP address is <BR>", "<BR>"); // ---------------------------------------------------- // Create the event // ---------------------------------------------------- EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList ); // ---------------------------------------------------- // Show info in console // ---------------------------------------------------- Console.WriteLine("Serverlist.cs: 2.0"); // ---------------------------------------------------- // Lets find internet ip // ---------------------------------------------------- DetectInternetIP(); } // ================================================== ================================ // Add a range of local lan ips // ================================================== ================================ private static void AddLocalLANIPRange(string RangeFrom, string RangeTo) { LocalLanIPRanges[LocalLanIPRangesCount] = new LocalLanIPRange(); LocalLanIPRanges[LocalLanIPRangesCount].RangeFrom = StringIPToUInt32IP(RangeFrom); LocalLanIPRanges[LocalLanIPRangesCount].RangeTo = StringIPToUInt32IP(RangeTo); LocalLanIPRangesCount = LocalLanIPRangesCount + 1; } // ================================================== ================================ // Convert a ip string to a binary unsigned int // ================================================== ================================ private static UInt32 StringIPToUInt32IP(string addr) { byte[] byteArray1 = IPAddress.Parse(addr).GetAddressBytes(); byte[] byteArray2 = IPAddress.Parse(addr).GetAddressBytes(); byteArray1[0] = byteArray2[3]; byteArray1[1] = byteArray2[2]; byteArray1[2] = byteArray2[1]; byteArray1[3] = byteArray2[0]; return BitConverter.ToUInt32( byteArray1, 0); } // ================================================== ================================ // Used to store the local lan ip ranges // ================================================== ================================ private class LocalLanIPRange { public UInt32 RangeFrom; public UInt32 RangeTo; } // ================================================== ================================ // Add a AutoIP mirror // ================================================== ================================ private static void AddAutoIPMirror(string sURL, string sStart, string sEnd) { AutoIPMirrors[AutoIPMirrorsCount] = new AutoIPMirror(); AutoIPMirrors[AutoIPMirrorsCount].sURL = sURL; AutoIPMirrors[AutoIPMirrorsCount].sStart = sStart; AutoIPMirrors[AutoIPMirrorsCount].sEnd = sEnd; AutoIPMirrorsCount = AutoIPMirrorsCount + 1; } // ================================================== ================================ // Used to store the Auto IP mirrors // ================================================== ================================ private class AutoIPMirror { public string sURL; public string sStart; public string sEnd; public UInt32 iFailures; } // ================================================== ================================ // Detect ip // ================================================== ================================ public static void DetectInternetIP() { // ---------------------------------------------------- // Autodetect the Internet IP // ---------------------------------------------------- if (InternetIPAutodetect) { DateTime UpdateTime = InternetIPAutodetectLast; UpdateTime = UpdateTime.AddMinutes(MinutesBetweenIPAutodetect); if (UpdateTime<DateTime.Now) { string NewAddress = null; NewAddress = FindInternetIP(); InternetIPAutodetectLast = DateTime.Now; if (NewAddress!=null) { Address = NewAddress; } } } } // ================================================== ================================ // The serverlist event // ================================================== ================================ public static void EventSink_ServerList( ServerListEventArgs e ) { try { // ---------------------------------------------------- // Lets find internet ip // ---------------------------------------------------- DetectInternetIP(); // ---------------------------------------------------- // Find the server ip to use for this user // ---------------------------------------------------- IPAddress ipAddr = FindMachineIP(e); // ---------------------------------------------------- // Send serverlist // ---------------------------------------------------- if (ipAddr != null) { e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) ); } else { e.Rejected = true; } } catch { e.Rejected = true; } } // ================================================== ================================ // Connects to a webserver that gives you your internet ip // ================================================== ================================ public static string FindInternetIP( ) { // ---------------------------------------------------- // Pick a random mirror // ---------------------------------------------------- Random rnd = new Random(); int UseMirror = (int)( rnd.NextDouble() * AutoIPMirrorsCount); string MyIP = ""; // ---------------------------------------------------- // Catch if the mirror is down // ---------------------------------------------------- try { // ---------------------------------------------------- // Get the webpage // ---------------------------------------------------- WebClient client = new WebClient(); byte[] pageData = client.DownloadData(AutoIPMirrors[UseMirror].sURL); MyIP = System.Text.Encoding.ASCII.GetString(pageData); // ---------------------------------------------------- // Find the string // ---------------------------------------------------- int iStart = MyIP.LastIndexOf(AutoIPMirrors[UseMirror].sStart); int iEnd = MyIP.IndexOf(AutoIPMirrors[UseMirror].sEnd, iStart+AutoIPMirrors[UseMirror].sStart.Length); MyIP = MyIP.Substring(iStart+AutoIPMirrors[UseMirror].sStart.Length, iEnd-iStart-AutoIPMirrors[UseMirror].sStart.Length ); MyIP = MyIP.Trim(); // ---------------------------------------------------- // Return value // ---------------------------------------------------- Console.WriteLine("Internet IP: {0} ({1})", MyIP, AutoIPMirrors[UseMirror].sURL); return MyIP; } catch { Console.WriteLine("Unable to autoupdate the Internet IP from {0}!", AutoIPMirrors[UseMirror].sURL); Console.WriteLine("----------------------------------------------------------------------"); Console.WriteLine(MyIP); Console.WriteLine("----------------------------------------------------------------------"); return null; } } // ================================================== ================================ // Calculates what server IP to use // ================================================== ================================ public static IPAddress FindMachineIP( ServerListEventArgs e ) { // ---------------------------------------------------- // Find the IP of the connecting user // ---------------------------------------------------- Socket sock = e.State.Socket; IPAddress theirAddress = ((IPEndPoint)sock.RemoteEndPoint).Address; IPAddress serverAddress; // ---------------------------------------------------- // Is it Loopback? // ---------------------------------------------------- if ( IPAddress.IsLoopback( theirAddress ) ) { return IPAddress.Parse( "127.0.0.1" ); } // ---------------------------------------------------- // Local // ---------------------------------------------------- UInt32 uint32Address = StringIPToUInt32IP(theirAddress.ToString()); for (UInt32 LocalLanIPRangesLoop = 0 ; LocalLanIPRangesLoop < LocalLanIPRangesCount; LocalLanIPRangesLoop++) { if ( (LocalLanIPRanges[LocalLanIPRangesLoop].RangeFrom <= uint32Address) && (LocalLanIPRanges[LocalLanIPRangesLoop].RangeTo >= uint32Address) ) { Resolve(Dns.GetHostName(), out serverAddress); Console.WriteLine("Player is reconnecting to " + serverAddress.ToString()); return serverAddress; } } // ---------------------------------------------------- // Internet addresses // ---------------------------------------------------- if (Address!=null) { Resolve(Address, out serverAddress); } else { Resolve(Dns.GetHostName(), out serverAddress); } Console.WriteLine("Player is reconnecting to " + serverAddress.ToString()); return serverAddress; } // ================================================== ================================ // Resolves dns names // ================================================== ================================ public static bool Resolve( string addr, out IPAddress outValue ) { try { outValue = IPAddress.Parse( addr ); return true; } catch { try { IPHostEntry iphe = Dns.Resolve( addr ); if ( iphe.AddressList.Length > 0 ) { outValue = iphe.AddressList[iphe.AddressList.Length - 1]; return true; } } catch { } } outValue = IPAddress.None; return false; } } } |
|
|
|
|
|
#12 (permalink) | |
|
Forum Expert
Join Date: Dec 2005
Location: Missouri , USA
Age: 38
Posts: 256
|
Quote:
ill try the Un single server serverlist.cs then tell ya what happens We never got ahit issue fixed but every morning at 6asm it restarts, i wake up at 7am and have an IM from a very faithfull Staff member with a great Hello server is down or UP message and restart uptp 10 times before she can login...This Issue Started After 1.0 - 2.0 change over for our Shards so most Likely thats the issue ![]() Anyway We will try to get the other Script loaded and see how it goes.... P.S Id Post my script here but im to lazy to remove the * Shard Info * Peace! |
|
|
|
|
|
|
#13 (permalink) | |
|
Forum Expert
Join Date: Dec 2005
Location: Missouri , USA
Age: 38
Posts: 256
|
Quote:
Winmerge would be a great place to run the Diffs on it but then again I think ill jsut try the Updated fixit's one and try it Thanks |
|
|
|
|
|
|
#14 (permalink) | |
|
Forum Expert
Join Date: Dec 2005
Location: Missouri , USA
Age: 38
Posts: 256
|
Quote:
Try to do this :P Code:
using System;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Network;
namespace Server.Misc
{
public class ServerList
{
// ================================================== ================================
// YOUR SERVERS NAME
// ================================================== ================================
public const string ServerName = "_ _ _ _ _ _ _ _";
// ================================================== ================================
// YOUR INTERNET IP OR DNS NAME
// Here you can select to autodetect your internet ip, or manualy specify
// Examples:
// public static string Address = "12.34.56.78";
// public static string Address = "shard.host.com";
// ================================================== ================================
public const bool InternetIPAutodetect = true;
public const int MinutesBetweenIPAutodetect = 1440;
public static string Address = null;
// ================================================== ================================
// Here are some values stored
// ================================================== ================================
private static LocalLanIPRange[] LocalLanIPRanges = new LocalLanIPRange[10];
private static UInt32 LocalLanIPRangesCount;
private static AutoIPMirror[] AutoIPMirrors = new AutoIPMirror[10];
private static UInt32 AutoIPMirrorsCount;
private static DateTime InternetIPAutodetectLast;
// ================================================== ================================
// Initialization
// ================================================== ================================
public static void Initialize()
{
// ----------------------------------------------------
// Select what port to use
// ----------------------------------------------------
Listener.Port = 2593;
// ----------------------------------------------------
// Load the local LAN ip ranges
// ----------------------------------------------------
AddLocalLANIPRange("10.0.0.0", "10.255.255.255");
AddLocalLANIPRange("192.168.0.0", "192.168.255.255");
AddLocalLANIPRange("172.16.0.0", "172.32.255.255");
AddLocalLANIPRange("169.254.0.0", "169.254.255.255");
// ----------------------------------------------------
// Load the Auto IP mirros
// ----------------------------------------------------
AddAutoIPMirror("http://www.findmyip.com/", "Your IP address is:<br>", "</FONT>");
AddAutoIPMirror("http://www.ipaddy.com/", "Your IP address is: ", "<br>");
AddAutoIPMirror("http://checkip.dyndns.org/", "Current IP Address: ", "</body>");
AddAutoIPMirror("http://ipid.shat.net/iponly/", "<title>", "</title>");
AddAutoIPMirror("http://www.edpsciences.com/htbin/ipaddress", "Your IP address is <B> ", " </B>");
AddAutoIPMirror("http://www2.simflex.com/ip.shtml", "Your IP address is <BR>", "<BR>");
// ----------------------------------------------------
// Create the event
// ----------------------------------------------------
EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList );
// ----------------------------------------------------
// Show info in console
// ----------------------------------------------------
Console.WriteLine("Serverlist.cs: 2.0");
// ----------------------------------------------------
// Lets find internet ip
// ----------------------------------------------------
DetectInternetIP();
}
// ================================================== ================================
// Add a range of local lan ips
// ================================================== ================================
private static void AddLocalLANIPRange(string RangeFrom, string RangeTo)
{
LocalLanIPRanges[LocalLanIPRangesCount] = new LocalLanIPRange();
LocalLanIPRanges[LocalLanIPRangesCount].RangeFrom = StringIPToUInt32IP(RangeFrom);
LocalLanIPRanges[LocalLanIPRangesCount].RangeTo = StringIPToUInt32IP(RangeTo);
LocalLanIPRangesCount = LocalLanIPRangesCount + 1;
}
// ================================================== ================================
// Convert a ip string to a binary unsigned int
// ================================================== ================================
private static UInt32 StringIPToUInt32IP(string addr)
{
byte[] byteArray1 = IPAddress.Parse(addr).GetAddressBytes();
byte[] byteArray2 = IPAddress.Parse(addr).GetAddressBytes();
byteArray1[0] = byteArray2[3];
byteArray1[1] = byteArray2[2];
byteArray1[2] = byteArray2[1];
byteArray1[3] = byteArray2[0];
return BitConverter.ToUInt32( byteArray1, 0);
}
// ================================================== ================================
// Used to store the local lan ip ranges
// ================================================== ================================
private class LocalLanIPRange
{
public UInt32 RangeFrom;
public UInt32 RangeTo;
}
// ================================================== ================================
// Add a AutoIP mirror
// ================================================== ================================
private static void AddAutoIPMirror(string sURL, string sStart, string sEnd)
{
AutoIPMirrors[AutoIPMirrorsCount] = new AutoIPMirror();
AutoIPMirrors[AutoIPMirrorsCount].sURL = sURL;
AutoIPMirrors[AutoIPMirrorsCount].sStart = sStart;
AutoIPMirrors[AutoIPMirrorsCount].sEnd = sEnd;
AutoIPMirrorsCount = AutoIPMirrorsCount + 1;
}
// ================================================== ================================
// Used to store the Auto IP mirrors
// ================================================== ================================
private class AutoIPMirror
{
public string sURL;
public string sStart;
public string sEnd;
public UInt32 iFailures;
}
// ================================================== ================================
// Detect ip
// ================================================== ================================
public static void DetectInternetIP()
{
// ----------------------------------------------------
// Autodetect the Internet IP
// ----------------------------------------------------
if (InternetIPAutodetect) {
DateTime UpdateTime = InternetIPAutodetectLast;
UpdateTime = UpdateTime.AddMinutes(MinutesBetweenIPAutodetect);
if (UpdateTime<DateTime.Now) {
string NewAddress = null;
NewAddress = FindInternetIP();
InternetIPAutodetectLast = DateTime.Now;
if (NewAddress!=null)
{
Address = NewAddress;
}
}
}
}
// ================================================== ================================
// The serverlist event
// ================================================== ================================
public static void EventSink_ServerList( ServerListEventArgs e )
{
try
{
// ----------------------------------------------------
// Lets find internet ip
// ----------------------------------------------------
DetectInternetIP();
// ----------------------------------------------------
// Find the server ip to use for this user
// ----------------------------------------------------
IPAddress ipAddr = FindMachineIP(e);
// ----------------------------------------------------
// Send serverlist
// ----------------------------------------------------
if (ipAddr != null)
{
e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) );
} else {
e.Rejected = true;
}
}
catch
{
e.Rejected = true;
}
}
// ================================================== ================================
// Connects to a webserver that gives you your internet ip
// ================================================== ================================
public static string FindInternetIP( )
{
// ----------------------------------------------------
// Pick a random mirror
// ----------------------------------------------------
Random rnd = new Random();
int UseMirror = (int)( rnd.NextDouble() * AutoIPMirrorsCount);
string MyIP = "";
// ----------------------------------------------------
// Catch if the mirror is down
// ----------------------------------------------------
try
{
// ----------------------------------------------------
// Get the webpage
// ----------------------------------------------------
WebClient client = new WebClient();
byte[] pageData = client.DownloadData(AutoIPMirrors[UseMirror].sURL);
MyIP = System.Text.Encoding.ASCII.GetString(pageData);
// ----------------------------------------------------
// Find the string
// ----------------------------------------------------
int iStart = MyIP.LastIndexOf(AutoIPMirrors[UseMirror].sStart);
int iEnd = MyIP.IndexOf(AutoIPMirrors[UseMirror].sEnd, iStart+AutoIPMirrors[UseMirror].sStart.Length);
MyIP = MyIP.Substring(iStart+AutoIPMirrors[UseMirror].sStart.Length, iEnd-iStart-AutoIPMirrors[UseMirror].sStart.Length );
MyIP = MyIP.Trim();
// ----------------------------------------------------
// Return value
// ----------------------------------------------------
Console.WriteLine("Internet IP: {0} ({1})", MyIP, AutoIPMirrors[UseMirror].sURL);
return MyIP;
}
catch
{
Console.WriteLine("Unable to autoupdate the Internet IP from {0}!", AutoIPMirrors[UseMirror].sURL);
Console.WriteLine("----------------------------------------------------------------------");
Console.WriteLine(MyIP);
Console.WriteLine("----------------------------------------------------------------------");
return null;
}
}
// ================================================== ================================
// Calculates what server IP to use
// ================================================== ================================
public static IPAddress FindMachineIP( ServerListEventArgs e )
{
// ----------------------------------------------------
// Find the IP of the connecting user
// ----------------------------------------------------
Socket sock = e.State.Socket;
IPAddress theirAddress = ((IPEndPoint)sock.RemoteEndPoint).Address;
IPAddress serverAddress;
// ----------------------------------------------------
// Is it Loopback?
// ----------------------------------------------------
if ( IPAddress.IsLoopback( theirAddress ) )
{
return IPAddress.Parse( "127.0.0.1" );
}
// ----------------------------------------------------
// Local
// ----------------------------------------------------
UInt32 uint32Address = StringIPToUInt32IP(theirAddress.ToString());
for (UInt32 LocalLanIPRangesLoop = 0 ; LocalLanIPRangesLoop < LocalLanIPRangesCount; LocalLanIPRangesLoop++)
{
if ( (LocalLanIPRanges[LocalLanIPRangesLoop].RangeFrom <= uint32Address) && (LocalLanIPRanges[LocalLanIPRangesLoop].RangeTo >= uint32Address) )
{
Resolve(Dns.GetHostName(), out serverAddress);
Console.WriteLine("Player is reconnecting to " + serverAddress.ToString());
return serverAddress;
}
}
// ----------------------------------------------------
// Internet addresses
// ----------------------------------------------------
if (Address!=null)
{
Resolve(Address, out serverAddress);
} else {
Resolve(Dns.GetHostName(), out serverAddress);
}
Console.WriteLine("Player is reconnecting to " + serverAddress.ToString());
return serverAddress;
}
// ================================================== ================================
// Resolves dns names
// ================================================== ================================
public static bool Resolve( string addr, out IPAddress outValue )
{
try
{
outValue = IPAddress.Parse( addr );
return true;
}
catch
{
try
{
IPHostEntry iphe = Dns.Resolve( addr );
if ( iphe.AddressList.Length > 0 )
{
outValue = iphe.AddressList[iphe.AddressList.Length - 1];
return true;
}
}
catch
{
}
}
outValue = IPAddress.None;
return false;
}
}
}
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|