vb如何实现文件下载(从指定网站下载到指定目录)?
比如我通过VB写一段简单的代码想从www.123.com/vb.txt文件下载到c盘的根目录下,用inet怎么写,请高手写一下代码,我新手不大会找。或者直接通过VB读取远...
比如我通过VB写一段简单的代码想从www.123.com/vb.txt文件下载到c盘的根目录下,用inet怎么写,请高手写一下代码,我新手不大会找。或者直接通过VB读取远程TXT文本文件的内容也行,后者更好。
展开
1个回答
展开全部
'写在一行
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Form_Load()
'写在一行
URLDownloadToFile(0, "http://www.123.com/vb.txt", "c:\vb.txt", 0, 0)
End Sub
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Form_Load()
'写在一行
URLDownloadToFile(0, "http://www.123.com/vb.txt", "c:\vb.txt", 0, 0)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询