Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 不使用Internet Explorer在VB.NET中下载文件_Windows_Vb.net_Visual Studio - Fatal编程技术网

Windows 不使用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

我的问题可能听起来很奇怪,但我想知道如何在没有Internet Explorer的情况下从VB.NET下载文件

我知道:

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的代码,但我实际上没有用那种方法,所以它永远不会出现。不,我不会提供一个“例子”。已经有加载了,您还应该阅读该类的文档。