string n; byte[] b1; OpenFileDialog op; private void btnBrowse_Click(object sender, EventArgs e) { op = new OpenFileDialog(); if (op.ShowDialog() == DialogResult.OK) { string t = textBox1.Text; t = op.FileName; FileInfo fi = new FileInfo(textBox1.Text = op.FileName); n = fi.Name + "." + fi.Length; TcpClient client = new TcpClient("DELL", 5055); StreamWriter sw = new StreamWriter(client.GetStream()); sw.WriteLine(n); sw.Flush(); label1.Text = "File Transferred...."; } } private void btnSend_Click(object sender, EventArgs e) { TcpClient client = new TcpClient("DELL", 5050); Stream s = client.GetStream(); b1 = File.ReadAllBytes(op.FileName); s.Write(b1, 0, b1.Length); client.Close(); label1.Text = "File Transferred...."; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)