我正在使用套接字处理一个小应用程序。环境是VBExpress 2015,net framework 4.7,Win10。我正在尝试使用我从微软获得的代码片段:https://msdn.microsoft/en-us/library/system.sockets.tcpclient.getstream(v = vs.110).aspx 写入流但是当我执行该行时为
I'm working on a small application using sockets. The environment is VBExpress 2015, net framework 4.7, Win10. I'm trying to use a code snippet I got from Microsoft atmsdn.microsoft/en-us/library/system.sockets.tcpclient.getstream(v=vs.110).aspx to write to the stream but when I execute the line
Dim sendBytes As [Byte]() = Encoding.UTF8.GetBytes("Is anybody there?")
我收到一个错误,说文件encoding.cs可以找不到。任何人都可以帮我弄清楚这里发生了什么并纠正这个错误吗?
I get an error that says the file encoding.cs can't be found. Can anyone help me figure out what's happening here and correct this error?
TIA ...
推荐答案
您是否有适当的编码参考?尝试在表单类之前将此system.text导入添加到表单的顶部。
Do you have the proper reference for the encoding? Try adding this system.text importsto the top of your form before the form class. Imports System.Text 'add this line Public Class Form2 Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim sendBytes As [Byte]() = Encoding.UTF8.GetBytes("Is anybody there?")
更多推荐
'找不到Encoding.cs'错误
发布评论