【问题标题】:How to specify proxy server and port with WebClient? [duplicate]如何使用 WebClient 指定代理服务器和端口? [复制]
【发布时间】:2014-05-15 05:42:28
【问题描述】:
Using client As New WebClient()
    Dim responseArray As Byte() = client.UploadFile(strUrl, strFileToUpload)
End Using

如何修改以上内容才能使用proxy?在上述场景中指定proxy serverport 的最佳方式是什么?

【问题讨论】:

    标签: .net vb.net proxy webclient


    【解决方案1】:

    在你的 WebClient 对象构造之后添加它

    client.Proxy = New WebProxy("YourProxyServerName", 80)
    

    【讨论】:

      猜你喜欢
      • 2010-10-23
      • 2013-08-22
      • 1970-01-01
      • 2013-06-02
      • 1970-01-01
      • 2016-09-06
      • 1970-01-01
      • 1970-01-01
      • 2022-08-18
      相关资源
      最近更新 更多