CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
18
Task/DNS-query/C-sharp/dns-query.cs
Normal file
18
Task/DNS-query/C-sharp/dns-query.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
private string LookupDns(string s)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Net.IPHostEntry ip = System.Net.Dns.GetHostEntry(s);
|
||||
|
||||
string result = ip.AddressList[0].ToString();
|
||||
|
||||
for (int i = 1; i < ip.AddressList.Length; ++i)
|
||||
result += ", " + ip.AddressList[i].ToString();
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (System.Net.Sockets.SocketException se)
|
||||
{
|
||||
return se.Message;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue