2014-04-05 76 views
1

我做了一个Windows窗体应用程序,它捕捉来自我的摄像头的视频流,并将其保存为.avi文件(我使用EMGUCV)。
如何将我的客户端应用程序连接到服务器以发送视频? 我没有插座和客户端 - 服务器通信的经验。 任何想法,代码示例,链接都将很有用。
在此先感谢!如何将视频流发送到C#中的服务器?

回答

0

这取决于服务器。如果它是一个FTP服务器(这将是足够的视频上传),使用WebClient对象与STOR方法:

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); 
     } 
    } 

更多信息on the official documentation here

相关问题