You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
590 B
C#

2 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SocketStudyTest
{
public class SocketTest
{
[Fact]
public void Test()
{
var hostName = Dns.GetHostName();
var ipaddressList = Dns.GetHostAddresses(hostName,AddressFamily.InterNetwork);
var first = ipaddressList.FirstOrDefault(ip => ip.ToString().StartsWith("192"));
if (first !=null)
{
}
var dd = IPAddress.Any.ToString();
}
}
}