从https而不是http下载文件

时间:2017-12-21 10:12:26

标签: .net vb.net

目前我用VB.NET编写的程序使用以下两种方式从我的网站下载文件:

1)My.computer.network.downloadfile(“http://www.example.com/abcd.txt”,“abcd.txt”,“username”,“password”)

2)第二个选项是web客户端

现在我可以在我的站点中启用SSL,它运行的是linux服务器。在这种情况下,上述系统将工作或我需要更改代码。网址中的http是否有效,或者我需要将其更改为https。

同样地,我使用webclient(例如

)从php脚本中读取数据
Dim web_client As Net.WebClient = New Net.WebClient, Info As String = ""
Dim response As IO.Stream = web_client.OpenRead("http://www.example.com/datetime.php")'

    ' Read the result.
    Dim stream_reader As New IO.StreamReader(response)
    Info = stream_reader.ReadToEnd()
    ' Close the stream reader and its underlying stream.
    stream_reader.Close()
    response.Close()

它会起作用还是需要进行更改?我正在使用VS 2008。

0 个答案:

没有答案
相关问题