Hexo博客增加一言API
根据你的需求,在合适地方加入一言。例如,打开主题layout下的文件common-article.ejs,加入一言:
VB下载网页文件或图片的方法
一、使用API函数URLDownloadToFile,下载网页、图片等其它文件到本地
引入API:
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
用法:1
2
3
4
5
6
7
8
9Private Sub test()
Dim v_URL As String, v_FileName As String, v_Result As Long
v_URL = "http://www.baidu.com/img/baidu_logo.gif"
v_FileName = App.Path & "\Baidu.bmp" '下载百度Logo图片
v_Result = URLDownloadToFile(0, v_URL, v_FileName, 0, 0) '下载文件,返回 0 表示成功
v_URL = "http://www.baidu.com"
v_FileName = App.Path & "\Baidu.html" '下载百度首页的网页
v_Result = URLDownloadToFile(0, v_URL, v_FileName, 0, 0) '下载文件,返回 0 表示成功
End Sub


