问题
I am trying to download a file using webclient in c#.
the remote port of the file location is 20114. How do I tell webclient to use 20114 port?
回答1:
set the url as http://www.website.com:20114/folder/file.ext
回答2:
My spontaneous guess (without having tried it) would be to simply include it in the url:
WebClient client = new WebClient();
client.DownloadFile(@"http://host:20114/file.ext", localFilename);
来源:https://stackoverflow.com/questions/995495/how-to-set-port-for-webclient-in-c