如何从c#windows 8 Metro App中的HostName获取IPAddress?

Gop*_*mal 6 c# windows-8

我正在将Windows窗体类库迁移到Metro App类库.在那里有一个代码块,从下面的主机名给出IPAddress,

IPHostEntry ipHostInfo = Dns.GetHostEntry(Address);   
IPAddress ipAddress = ipHostInfo.AddressList[0];// IPAddress.Parse(address);
IPEndPoint endPoint = new IPEndPoint(ipAddress, Port);
Run Code Online (Sandbox Code Playgroud)

例如:

地址 : talk.google.com

IP地址 : xx.xxx.xxx.xx

但我已经看到了没有IPHostEntry或者Dns还是IPAddress在Metro应用System.Net..

如果有人知道的意思请告诉我在Windows 8 metro应用程序中替换这些.

Isa*_*ran 1

检查如何在 Metro/WinRT 中将主机名解析为 IP 地址?并将“http”替换为 https 并尝试。

IE

await clientSocket.ConnectAsync(serverHost, "https");
Run Code Online (Sandbox Code Playgroud)