Rimosso problema GetDns x app
This commit is contained in:
@@ -19,22 +19,27 @@ namespace GPW.CORE.Comp
|
||||
{
|
||||
string devIp = firstIp;
|
||||
IPAddress clientIP = IPAddress.Parse(devIp);
|
||||
IPHostEntry GetIPHost = Dns.GetHostEntry(clientIP);
|
||||
if (GetIPHost != null)
|
||||
try
|
||||
{
|
||||
// se trovo + di 1 ip cerco il primo NON IPV6...
|
||||
if (GetIPHost.AddressList.Count() > 1)
|
||||
IPHostEntry GetIPHost = Dns.GetHostEntry(clientIP);
|
||||
if (GetIPHost != null)
|
||||
{
|
||||
foreach (IPAddress item in GetIPHost.AddressList)
|
||||
// se trovo + di 1 ip cerco il primo NON IPV6...
|
||||
if (GetIPHost.AddressList.Count() > 1)
|
||||
{
|
||||
if (item.AddressFamily == AddressFamily.InterNetwork)
|
||||
foreach (IPAddress item in GetIPHost.AddressList)
|
||||
{
|
||||
devIp = item.ToString();
|
||||
break;
|
||||
if (item.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
devIp = item.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return devIp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="post-build.ps1">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>post-build.cs</LastGenOutput>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user