개정판 a1e2ba68
markus 외부주소 오류 수정
Change-Id: I03bd3df4edb78472d7d45f7a8c5db87fdfda226b
CommonLib/DNSHelper.cs | ||
---|---|---|
19 | 19 |
|
20 | 20 |
if ((networkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet || |
21 | 21 |
networkInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211) |
22 |
&& networkInterface.OperationalStatus == OperationalStatus.Up) |
|
22 |
&& networkInterface.OperationalStatus == OperationalStatus.Up |
|
23 |
&& !networkInterface.Name.Contains("vEthernet") && !networkInterface.Name.Contains("vmware")) |
|
23 | 24 |
{ |
24 | 25 |
IPInterfaceProperties ipProperties = networkInterface.GetIPProperties(); |
25 | 26 |
IPAddressCollection dnsAddresses = ipProperties.DnsAddresses; |
... | ... | |
53 | 54 |
|
54 | 55 |
return null; |
55 | 56 |
} |
57 |
public static IPAddress GetClientAdress() |
|
58 |
{ |
|
59 |
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); |
|
60 |
|
|
61 |
foreach (NetworkInterface networkInterface in networkInterfaces) |
|
62 |
{ |
|
63 |
if ((networkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet || |
|
64 |
networkInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211) |
|
65 |
&& networkInterface.OperationalStatus == OperationalStatus.Up |
|
66 |
&& !networkInterface.Name.Contains("vEthernet") && !networkInterface.Name.Contains("vmware")) |
|
67 |
{ |
|
68 |
IPInterfaceProperties ipProperties = networkInterface.GetIPProperties(); |
|
69 |
IPAddressCollection dnsAddresses = ipProperties.DnsAddresses; |
|
70 |
|
|
71 |
foreach (UnicastIPAddressInformation ip in ipProperties.UnicastAddresses) |
|
72 |
{ |
|
73 |
if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) |
|
74 |
{ |
|
75 |
return ip.Address; |
|
76 |
} |
|
77 |
} |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
81 |
return null; |
|
82 |
} |
|
56 | 83 |
|
57 | 84 |
public static async Task<IPHostEntry> GetHostEntryAsync() |
58 | 85 |
{ |
내보내기 Unified diff