如何将a.txt文件保存到本地?
6 个解决方案
#1
用WinSock以HTTP从原地址下载?
#2
有没有用WebBrowser的方法?
#3
浏览器中能看到的内容,在IE缓存下都有。还下载什么,直接到缓存目录里查找就可以了。
使用API函数:
FindFirstUrlCacheEntry
FindNextUrlCacheEntry
查找即可
天狼工作室 http://www.j2soft.cn/
使用API函数:
FindFirstUrlCacheEntry
FindNextUrlCacheEntry
查找即可
天狼工作室 http://www.j2soft.cn/
#4
我记得有一个很简单的方法就能保存,高手写一下,谢谢
#5
引用 microsoft html object library
Dim HttpUrl As String, j, ts As String
HttpUrl = "http://www.baidu.com/a.txt"
If IsNull(HttpUrl) = True Or HttpUrl = "$False$" Then
Exit Sub
End If
Dim Http
Set Http = CreateObject("MSXML2.XMLHTTP")
Http.open "GET", HttpUrl, False
Http.send
If Http.readyState <> 4 Then
Set Http = Nothing
Exit Sub
End If
s = StrConv(Http.responseBody, vbUnicode)
open app.path &"\a.txt" for output as #1
print #1 ,a
close #1
Set Http = Nothing
If Err.Number <> 0 Then
Err.Clear
End If
Dim HttpUrl As String, j, ts As String
HttpUrl = "http://www.baidu.com/a.txt"
If IsNull(HttpUrl) = True Or HttpUrl = "$False$" Then
Exit Sub
End If
Dim Http
Set Http = CreateObject("MSXML2.XMLHTTP")
Http.open "GET", HttpUrl, False
Http.send
If Http.readyState <> 4 Then
Set Http = Nothing
Exit Sub
End If
s = StrConv(Http.responseBody, vbUnicode)
open app.path &"\a.txt" for output as #1
print #1 ,a
close #1
Set Http = Nothing
If Err.Number <> 0 Then
Err.Clear
End If
#6
open app.path &"\a.txt" for output as #1
print #1 , a
close #1
a改为s即可
print #1 , a
close #1
a改为s即可
#1
用WinSock以HTTP从原地址下载?
#2
有没有用WebBrowser的方法?
#3
浏览器中能看到的内容,在IE缓存下都有。还下载什么,直接到缓存目录里查找就可以了。
使用API函数:
FindFirstUrlCacheEntry
FindNextUrlCacheEntry
查找即可
天狼工作室 http://www.j2soft.cn/
使用API函数:
FindFirstUrlCacheEntry
FindNextUrlCacheEntry
查找即可
天狼工作室 http://www.j2soft.cn/
#4
我记得有一个很简单的方法就能保存,高手写一下,谢谢
#5
引用 microsoft html object library
Dim HttpUrl As String, j, ts As String
HttpUrl = "http://www.baidu.com/a.txt"
If IsNull(HttpUrl) = True Or HttpUrl = "$False$" Then
Exit Sub
End If
Dim Http
Set Http = CreateObject("MSXML2.XMLHTTP")
Http.open "GET", HttpUrl, False
Http.send
If Http.readyState <> 4 Then
Set Http = Nothing
Exit Sub
End If
s = StrConv(Http.responseBody, vbUnicode)
open app.path &"\a.txt" for output as #1
print #1 ,a
close #1
Set Http = Nothing
If Err.Number <> 0 Then
Err.Clear
End If
Dim HttpUrl As String, j, ts As String
HttpUrl = "http://www.baidu.com/a.txt"
If IsNull(HttpUrl) = True Or HttpUrl = "$False$" Then
Exit Sub
End If
Dim Http
Set Http = CreateObject("MSXML2.XMLHTTP")
Http.open "GET", HttpUrl, False
Http.send
If Http.readyState <> 4 Then
Set Http = Nothing
Exit Sub
End If
s = StrConv(Http.responseBody, vbUnicode)
open app.path &"\a.txt" for output as #1
print #1 ,a
close #1
Set Http = Nothing
If Err.Number <> 0 Then
Err.Clear
End If
#6
open app.path &"\a.txt" for output as #1
print #1 , a
close #1
a改为s即可
print #1 , a
close #1
a改为s即可