无法在 Windows 8 Metro 风格应用程序中使用 IPAddress 或类似类型 [英] unable to use IPAddress or similar type in windows 8 metro style apps

查看:28
本文介绍了无法在 Windows 8 Metro 风格应用程序中使用 IPAddress 或类似类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在 Windows 8 Metro 应用程序中使用 System.Net.IPAddress 或任何类似类型时遇到困难.我正在创建一个将在 Intranet 环境中运行的应用程序,用户将使用 IPAddress 连接到远程服务器.

I am finding difficulty in using System.Net.IPAddress or any similar types in Windows 8 Metro Apps. I am creating an application that will run in an intranet environment and the users will connect to remote servers using IPAddress.

但不知何故我无法使用它.另外,在 Windows.Networking.EndpointPair 类中,我找不到任何专门传递 IPAddress 的选项

But somehow I am not able to use it. Also, in Windows.Networking.EndpointPair class, I cant find any option to pass IPAddress specifically

请帮忙解决这个问题.提前感谢帮助

Kindly help with this. Thanx of help in advance

推荐答案

您可以使用 HostName 类 表示 IP 地址.当您创建 EndpointPair 时,您有一个远程和一个本地主机.查看 StreamSocket 示例.System.Net.IPAddress 不是 .NET Core 配置文件的一部分,因此无法从 Metro 风格应用程序中使用.

You can use the HostName class to represent an IP Address. When you create the EndpointPair, you have a remote and a local host. Check out the StreamSocket sample. System.Net.IPAddress is not part of the .NET Core Profile and is thus not available from Metro style apps.

这篇关于无法在 Windows 8 Metro 风格应用程序中使用 IPAddress 或类似类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆