D
D
des1roer2016-05-25 10:02:07
C++ / C#
des1roer, 2016-05-25 10:02:07

C# save screenshot to server?

can i save the file locally

Graphics graph = null;
            var bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            graph = Graphics.FromImage(bmp);
            graph.CopyFromScreen(0, 0, 0, 0, bmp.Size);

            Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
            string time = unixTimestamp.ToString();

            bmp.Save(time + ".png", ImageFormat.Png);

logically, it can be sent to a Linux server, but I think you can form a tsp stream from a buffer and make it easier. how to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2016-05-25
@des1roer

So it all depends on what it will accept on the server side.
You can send a normal POST request.
You can open a socket and write there byte by byte.
It is possible via ftp.
Yes, at least by mail.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question