sockets - 在Xamarin for Windows Phone中使用Windows.Networking.Sockets

标签 sockets xamarin windows-phone-8.1 cross-platform tcpclient

我在跨平台应用程序中将System.Net.Sockets用作TCP/IP Client。我在SharedProject上有负责连接/接收数据的类。我可以在Android中运行应用程序,但是我发现System.Net.Sockets中没有Windows Phone 8.1。我读到可以与Windows Phone一起使用,可以使用Windows.Networking.Sockets,但是当我在sing Windows.Networking.Sockets的类中添加u Shared Project时出现错误:

The type or namespace name 'Windows' could not be found



我的问题是如何将System.Net.SocketsWindows.Networking.SocketsWindows Phone 8.1一起使用?

最佳答案

根据此previous question,您需要在项目中添加System.Dll才能使用System.Net.Sockets

或者,您也可以尝试一下Sockets Plugin for Xamarin

关于sockets - 在Xamarin for Windows Phone中使用Windows.Networking.Sockets,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36621969/

相关文章:

python - socket.py : TypeError: a float is required 上的深度错误

c - 如何修复 "format specifies type ' char *' but the argument has type ' char * *'"错误

javascript - 使用 Tor 网络执行 JavaScript,无需人工交互

Visual Studio 2015 中未检测到 Android 手机

c# - 禁用自动推送远程通知 ios

ios - Xamarin IOS 暂时更改按钮的颜色

visual-studio - Windows Phone 8.1 模拟器卡在启动操作系统

c# - Windows Phone 8.1 在代码隐藏中手动更改资源文件

php - PHP 脚本可以检测套接字是否已关闭吗?

c# - 是否可以将现有的 Windows Phone 8 应用程序更新到 Windows Phone Store 8.1