How to easily send files (including Audio, Video, doc or any type of file) from Client to Server.
It is necessary to specify the server's "Computer Name" in the TcpClient space like:
In this the TcpClient specified the Computer Name as "SwtRascal".
First we have to design a form for the client such as:

And place an OpenFileDialog from the ToolBox-> Dialogs-> OpenFileDialog control.
Then Double-Click the form; the coding page will open; in that specify the following namespaces:
Then write code for the button1 (Browse) and the button2 (Send) as in the following.
For example:
CLIENT PROGRAM
For Server : Open a new C# Windows Application form.
Create and design a Form for Server like:
![File2.gif]()
Then Place a folderBrowserDialog from the ToolBox->Dialogs-> folderBrowserDialog.
After Designing the Form, Double-Click the form; the coding page will open; in that specify the following namespaces:
Then write code for the button1 (Browse) and for the Form Load function, such as in the following.
If you want to specify an IP Address for the system then include code such as:
Instead of using the code TcpListener list = new TcpListener(port1);
It only specifies the port address.
Use this code.
It specifies the IP Address and Port.
Below the Comment line shows the ipaddress option..
For example:
SERVER PROGRAM
After Designing the Forms for Client and Server, run the Server first and after that run the Client.
Output: Client Selecting the Source File
![File3.gif]()
For Server: Selecting the Target location
![File4.gif]()
After Selecting the Target Location, in the Client click the Send button; the file will be sent to the target location.
![File5.gif]()
I hope you will understand the File Transfer operation in a C#.Net Windows application…