본문 바로가기

전체 글116

[C#] DNS서버 구하기 [C#] DNS 서버 구하기 How to get DNS in C# using System.Net; using System.Net.NetworkInformation; private void showDnsServer() { NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); ArrayList dnsAddrList = new ArrayList(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); if (adapter.OperationalStatus == Operation.. 2019. 8. 29.
[C#] Gateway 구하기 [C#] Gateway 구하기 How to get gateway in C# using System.Net.NetworkInformation; privite void showGateway() { NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); string gateway = string.Empty; foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); GatewayIPAddressInformationCollection addresses = adapterProperties.. 2019. 8. 28.
[C#] 로컬 IP 주소 구하기 [C#] 로컬 IP 주소 구하기 How to get ip address in C# using System.Net; private void ShowIP() { IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName()); string IP4Addr = string.Empty; foreach (Ipaddress ip in host.AddressList) { if (ip.AddressFamily == AddressFamily.InterNetwork) { ip4Addr = ip.ToString(); Console.WriteLine(ip4Addr); } } } 2019. 8. 27.
[C#]개체가 IConvertible을 구현해야 합니다. 개체가 IConvertible을 구현해야 합니다. 형변환등을 제대로 하지 않았을 때 발생 Solution) .ToString(); 혹은 .text등 제대로 변환하여 파싱하였는지 확인 2019. 3. 8.