Windows 不使用Internet Explorer在VB.NET中下载文件
我的问题可能听起来很奇怪,但我想知道如何在没有Internet Explorer的情况下从VB.NET下载文件 我知道:Windows 不使用Internet Explorer在VB.NET中下载文件,windows,vb.net,visual-studio,Windows,Vb.net,Visual Studio,我的问题可能听起来很奇怪,但我想知道如何在没有Internet Explorer的情况下从VB.NET下载文件 我知道: My.Computer.Network.DownloadFile( "http://www.cohowinery.com/downloads/WineList.txt", "C:\Documents and Settings\All Users\Documents\WineList.txt") 但当他尝试时,他使用In
My.Computer.Network.DownloadFile(
"http://www.cohowinery.com/downloads/WineList.txt",
"C:\Documents and Settings\All Users\Documents\WineList.txt")
但当他尝试时,他使用Internet Explorer下载它。我下载文件的网站与Internet Explorer不兼容。所以它没有下载
我如何使用另一个web浏览器(例如Firefox)下载它
谢谢大家! 检查
您可能需要一个简单的示例:
Dim client As New WebClient()
client.Credentials = New NetworkCredential("UserName", "Password") ' If need be.
client.DownloadFile(url, fileName)
使用
WebClient
类。那你就不用网络浏览器了。我不知道你用过IE的代码,但我实际上没有用那种方法,所以它永远不会出现。不,我不会提供一个“例子”。已经有加载了,您还应该阅读该类的文档。