-- 作者:大红袍
-- 发布时间:2016/4/6 9:12:00
--
你ftp搭建得有问题吧?可能不支持这个直接下载的协议。试试自己封装一个方法,比如
Dim url As String = "http://www.foxtable.com/download/80222/update.zip"
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
Dim stm As System.IO.Stream = rsps.GetResponseStream()
Dim buffer(1024) As Byte Dim fileStream As new System.IO.FileStream("d:\\update.zip", System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite) Dim count As Integer = stm.Read(buffer, 0, buffer.Length)
Do While count > 0 buffer.Initialize fileStream.Write(buffer, 0, count) fileStream.Flush() count = stm.Read(buffer, 0, buffer.Length) Loop
fileStream.Close() stm.Close
|