static void Main(string[] args) { ServerControl serverControl = new ServerControl(); serverControl.Start(); Console.ReadKey(); }
public Client(TcpClient client, ServerControl sControl, int serverId) { id = serverId; serverControl = sControl; tcpClient = client; clientStream = new SslStream(tcpClient.GetStream(), true); formatter = new BinaryFormatter(); listenThread = new Thread(new ThreadStart(handler)); listenThread.Start(); }
static void Main(string[] args) { //new ServerControl().Start(); //return; ServerControl server = new ServerControl(); server.Start(); Console.ReadKey(); }
static void Main(string[] args) { int port; if (args.Length > 0) { port = int.Parse(args[0]); } else { port = 1157; } ServerControl serverControl = new ServerControl(); serverControl.Start(port); Console.WriteLine("127.0.0.1:{0} --服务启动成功", port); Console.ReadKey(); }
private void btnOK_Click(object sender, EventArgs e) { txtIP_Validating(sender, new CancelEventArgs()); txtName_Validating(sender, new CancelEventArgs()); txtPort_Validating(sender, new CancelEventArgs()); cmbColours_Validating(sender, new CancelEventArgs()); if (ValidationInput.ValidatedIP && ValidationInput.ValidatedPort) { if (ValidationInput.ValidatedUserName && ValidationInput.ValidatedColor) { _c.IP = IPAddress.Parse(txtIP.Text); _c.Port = ushort.Parse(txtPort.Text); Hide(); ServerControl newControl = new ServerControl(_c, new Parcel(txtName.Text, DateTime.Now, txtName.Text + " welcomes you to Chat!", Color.FromName(cmbColours.SelectedItem.ToString()))); newControl.Show(); } } }