|
亿众国际点对点文件传输程序(12) this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.Name = "EzoneSend"; this.Text = "亿众国际点对点文件传输软体发送端"; this.Load += new System.EventHandler(this.EzoneSend_Load); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.groupBox4.ResumeLayout(false); this.ResumeLayout(false); } #endregion /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.Run(new EzoneSend()); } private void button1_Click(object sender, System.EventArgs e) { //选择要进行传输的文件 if(this.openFileDialog1.ShowDialog()==DialogResult.OK) { FileInfo EzoneFile=new FileInfo(this.openFileDialog1.FileName); this.textBox1.Text=EzoneFile.FullName; this.textBox2.Text=EzoneFile.Name; this.textBox3.Text=EzoneFile.Length.ToString(); } } private void StartSend() { //创建一个文件对象 FileInfo EzoneFile=new FileInfo(this.textBox1.Text); //打开文件流 FileStream EzoneStream=EzoneFile.OpenRead(); //包的大小 int PacketSize=int.Parse(this.textBox6.Text);
|