public Server(string ip, int port, 实体类 userInfo) { _userInfo = userInfo; IPAddress localAddr = IPAddress.Parse(ip); server = new TcpListener(localAddr, port); server.Start(); StartListener(); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public 实体ViewModel() { UserInfo = new 实体类(); //下拉框的初始数据 CombboxList = new List <ComplexInfoModel>() { new ComplexInfoModel() { Key = "1", Text = "苹果" }, new ComplexInfoModel() { Key = "2", Text = "香蕉" } }; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public 实体ViewModel() { UserInfo = new 实体类(); //下拉框的初始数据 CombboxList = new List <ComplexInfoModel>() { new ComplexInfoModel() { Key = "1", Text = "苹果" }, new ComplexInfoModel() { Key = "2", Text = "香蕉" } }; Thread t = new Thread(delegate() { // replace the IP with your system IP Address... Server myserver = new Server("127.0.0.1", 13000, UserInfo); }); t.Start(); Console.WriteLine("Server Started...!"); Client tcp通讯 = new Client(UserInfo); LoadTcpClient = new RelayCommand(CQCQCQ); Thread t2 = new Thread(async delegate() { // replace the IP with your system IP Address... Websocket myserver = new Websocket(); await myserver.Server(); }); t2.Start(); }
public Client(实体类 userInfo) { _userInfo = userInfo; //Console.ReadLine(); }