im trying to use the SendFile method https://msdn.microsoft.com/en-us/library/sx0a40c2(v=vs.110).aspx
TcpClient client;
private void Form1_Load(object sender, EventArgs e)
{
client = new TcpClient();
client.Connect("10.0.0.1", 10);
string fileName = @"C:\Users\itapi\Desktop\da.jpg";
Console.WriteLine("Sending {0} to the host.", fileName);
client.Client.SendFile(fileName);
}
server code:
TcpListener listener;
TcpClient cl;
private void Form1_Load(object sender, EventArgs e)
{
listener = new TcpListener(IPAddress.Any, 10);
listener.Start();
cl = listener.AcceptTcpClient();
}
my question is: how i am supposed to get the file in the other side? i dont want to use networkstream only pure socket. any help would be apperciated