Adding a shared library for common classes
This commit is contained in:
1 parent
6b14d1264a
commit
4acf091511
28 files changed
+587
-325
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace Aurora.Utils
|
||||
{
|
||||
public static class IpUtil
|
||||
{
|
||||
public static string GetLocalIPAddress()
|
||||
{
|
||||
string returnIp = "";
|
||||
var host = Dns.GetHostEntry(Dns.GetHostName());
|
||||
foreach (var ip in host.AddressList)
|
||||
{
|
||||
if (ip.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
returnIp = ip.ToString();
|
||||
}
|
||||
}
|
||||
return returnIp;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user