我的问题听起来可能很奇怪,但我想知道如何在没有Internet Explorer的情况下从VB.NET下载文件。
我知道:
My.Computer.Network.DownloadFile(
"http://www.cohowinery.com/downloads/WineList.txt",
"C:Documents and SettingsAll UsersDocumentsWineList.txt")
但当他尝试时,他会使用Internet Explorer下载。我下载文件的网站与Internet Explorer不兼容。所以它不会下载。
如何使用其他网络浏览器(例如Firefox(下载?
谢谢!
检查WebClient。DownloadFile方法。
你可能需要一个简单的例子:
Dim client As New WebClient()
client.Credentials = New NetworkCredential("UserName", "Password") ' If need be.
client.DownloadFile(url, fileName)