从桌面上的Windows窗体应用程序中上传服务器中的文件

问题描述:

假设我在桌面的特定目录中有图像 img.jpg ,例如 D:\\\ examplesimg \ img.jpg 。现在我想将图像上传到我的localhost服务器,例如 http:// localhost:6060 / desktop_app / image / 我该怎么做?



我尝试了什么:



现在我正在努力。我使用WebClient上传文件。

suppose i have an image img.jpg in a specific directory of my desktop such as D:\sampleimg\img.jpg. Now i want to upload the image to my localhost server such as http://localhost:6060/desktop_app/image/ How can i do that?

What I have tried:

Now i am working on it. I have used WebClient to upload file.

最简单的方法是使用FTP:简单的C#FTP类 [ ^ ]应该有所帮助。
Easiest way is to use FTP: Simple C# FTP Class[^] should help.