프로젝트

일반

사용자정보

개정판 a1e2ba68

IDa1e2ba68c0d36fece497bc247cc263a2b9b0046f
상위 d60f94ee
하위 b42dd24d

김태성이(가) 3년 이상 전에 추가함

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

클립보드 이미지 추가 (최대 크기: 500 MB)