Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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