Frage

I made a Windows Form Application which captures video stream from my webcam and saves it as an .avi file.(I used EMGUCV for that).
How do i connect my client application to a server in order to send the video ? I have no experience with sockets and client-server communication. Any ideas, code samples, links will be useful.
Thanks in advance!

War es hilfreich?

Lösung

It depends on the server. If it's an FTP server (which would be adequate for a video upload), use the WebClient object with the STOR method:

    void Upload(string ftpServer, string userName, string password, string filename)
    {
        using(var client = new WebClient())
        {
            client.Credentials = new NetworkCredential(userName, password);
            client.UploadFile(new Uri(ftpServer + "/" + new FileInfo(filename).Name), "STOR", filename);
        }
    }

More info on the official documentation here.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top