急!!
--------------------编程问答-------------------- 除 --------------------编程问答-------------------- socketSent这个类的配置呢? --------------------编程问答--------------------新手,,求别喷! --------------------编程问答--------------------
不懂啊 --------------------编程问答-------------------- 这段代码有吗
01.//发送文件
02.private void btn_sendFile_Click(object sender, EventArgs e)
03.{
04. //打开文件
05. OpenFileDialog dlg = new OpenFileDialog();
06.
07. if (dlg.ShowDialog() == DialogResult.OK)
08. {
09. //初始化接受套接字:寻址方案,以字符流方式和Tcp通信
10. socketSent = new Socket(AddressFamily.InterNetwork,
11. SocketType.Stream,
12. ProtocolType.Tcp);
13.
14. //设置服务器IP地址和端口
15. ipSent = new IPEndPoint(IPAddress.Parse(ip), 8001);
16. //与服务器进行连接
17.
18. ClassSocket socketConnet = new ClassSocket(socketSent, ipSent);
19. Thread tConnection = new Thread(new ThreadStart(socketConnet.SocketConnect));
20. tConnection.Start();
21.
22. Thread.Sleep(100);
23. //将要发送的文件加上"DAT"标识符
24.
25. ClassSentFile sentFile = new ClassSentFile(dlg, socketSent);
26. Thread tSentFile = new Thread(new ThreadStart(sentFile.SentFile));
27. tSentFile.Start();
28.
29.
30. }
31.}
--------------------编程问答-------------------- 我去 --------------------编程问答-------------------- 有的,就是从这段跳过去的。改成UDP就好了,但出现什么,流序列错误之类的,换成TCP传输都不行了
补充:.NET技术 , C#