[英]Upload/download files securly, winforms c# and asp.net
From a winforms application, I need to upload & download files to an asp.net web server using http/https. 从Winforms应用程序中,我需要使用http / https将文件上传并下载到asp.net Web服务器。
Is there an easy way to do this? 是否有捷径可寻?
The WebClient class should be able to do everything you need to do. WebClient类应该能够执行您需要做的所有事情。 Use either
UploadFileAsync
Or UploadDataAsync
for the upload (and their counterparts for the download), normal HTTP authentication for the username and password (see the Credentials
property) and the UploadProgressChanged
event for tracking progress for your progress bar. 使用
UploadFileAsync
或UploadDataAsync
进行上传(及其对应版本进行下载),对用户名和密码使用常规HTTP身份验证(请参阅Credentials
属性),并使用UploadProgressChanged
事件跟踪进度条的进度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.