Beispiel #1
0
 public Connection(int Id, Socket Connect, Server Server)
 {
     this.ConId = Id;//get connection id
     this.Sock = Connect;//record connection socket
     this.Server = Server;//server class
     this.PathRoot = "\\Storage Card\\WebPage";
 }
Beispiel #2
0
 private void BtnOpenServer_Click(object sender, EventArgs e)
 {
     Garllery.GarlleryDirPath = TxtDirectory.Text;
     DirectoryInfo Dir = new DirectoryInfo(Garllery.GarlleryDirPath);
     if (!Dir.Exists)
     {
         MessageBox.Show("目标文件夹不存在!");
         return;
     }
     TxtPort.Enabled = false;
     TxtDirectory.Enabled = false;
     BtnOpenServer.Enabled = false;
     server = new Server[HostIP.Length];
     for (int i = 0; i < HostIP.Length; i++)
     {
         server[i] = new Server(HostIP[i], TxtPort.Text, this);
         server[i].Start();
     }
     BtnCloseServer.Enabled = true;
 }