2

我正在尝试在 c# 中使用 webclient 下载文件。

文件位置的远程端口是 20114。如何告诉 webclient 使用 20114 端口?

4

2 回答 2

8

将网址设置为http://www.website.com:20114/folder/file.ext

于 2009-06-15T10:59:56.123 回答
3

我的自发猜测(没有尝试过)将简单地将其包含在 url 中:

WebClient client = new WebClient();
client.DownloadFile(@"http://host:20114/file.ext", localFilename);
于 2009-06-15T11:01:43.763 回答