I haven't written an article for a long time. Today I share my article on LAN desktop sharing software. I believe many people have done it and may encounter some problems. I will test it one by one here.
These include LAN file transmission, desktop screenshots, and image compression. Code is not encapsulated to demonstrate more straightforward functions of the program.
It is very easy to get desktop images.
= =bitmap);
g.CopyFromScreen(, , , , bitmap.Size);
bitmap;
}
Client
Define global variables
Socket sendsocket;
Button event (connect to the server and send the desktop)
btnConn_Click(= IPEndPoint ipendpiont = IPEndPoint(IPAddress.Parse(textBox1.Text.Trim()), Thread th = Thread(=
Thread execution body
(= [] b =
Server (there is a PictureBox in the form)
Define global variables
Socket hostSocket;Thread thread;
Button event (enable service)
btnStart_Click(= = IPEndPoint(IPAddress.Parse(textBox1.Text.Trim()), == Thread(=
Thread execution body
([] b = [ * = ==
If you test this program, you will find some problems, and I will handle your problems later.
Because the program is simple, no source code attachment will be uploaded.