C# Socket 通信
服务端 Service.cs using System ; using System . Collections . Generic ; using System . Net ; using System . Net . Sockets ; using System . Text ; using System . Threading ; using System . Windows . Forms ; namespace csharpService { public partial class Service : Form { public Service ( ) { InitializeComponent ( ) ; ///多线程编程中,如果子线程需要使用主线程中创建的对象和控件,最好在主线程中体现进行检查取消 /// CheckForIllegalCrossThreadCalls = false ; /// 获取本地IP textBox_current_address . Text = IPAddress . Any . ToString ( ) ; } /// 创建一个字典,用来存储记录服务器与客户端之间的连接(线程问题) /// private Dictionary < string , Socket > clientList = new Dictionary <