using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Net; using System.Net.Sockets; namespace client { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); textBox1.Text = ofd.FileName; } private void button2_Click(object sender, EventArgs e) { Stream Fs = File.OpenRead(textBox1.Text); Byte[] buffer = new Byte[Fs.Length]; Fs.Read(buffer, 0, buffer.Length); TcpClient socket = new TcpClient("10.10.3.137", 10); NetworkStream nw = socket.GetStream(); nw.Write(buffer, 0, buffer.Length); nw.Close(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)