易截截图软件、单文件、免安装、纯绿色、仅160KB

VB: 取网页源码

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 Const CP_UTF8 = 65001
Private Declare Function MultiByteToWideChar Lib "kernel32" ( _
    ByVal CodePage As Long, ByVal dwFlags As Long, _
    ByVal lpMultiByteStr As Long, ByVal cchMultiByte As Long, _
    ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long '取网页源码
Public Function webTxtGet(ByVal Url1 As String) As String
   Dim strFile As String
   Dim lngReturn As Long
   Dim TextLine As String, textCon As String
   Dim Big5str As String
    Dim tmpUTF8() As Byte
    Dim lLength As Long, lBytes As Long, lWC As Long
On Error Resume Next
   strFile = App.Path & "\txtWeb.txt"
   Open strFile For Output As #1
   Close #1
   lngReturn = URLDownloadToFile(0, Url1, strFile, 0, 0)
   Open strFile For Binary As #1
    webTxtGet = Space(LOF(1))
    Get #1, , webTxtGet
   Close #1
  Kill strFile
End Function '取网页源码_如果网页是UTF-8
Public Function webTxtGet_utf8(ByVal Url1 As String) As String
   Dim strFile As String
   Dim lngReturn As Long
   Dim TextLine As String, textCon As String
   Dim Big5str As String
    Dim tmpUTF8() As Byte
    Dim lLength As Long, lBytes As Long, lWC As Long
On Error Resume Next
   strFile = App.Path & "\


相关文档:

VB用COM口发WAPPUSH,返回+CMS ERROR: 500

 给出代码如下:
Type WAPPushPDUStruct
    SMSCLen As String
    SMSCType As String
    SMSC As String
    PROTOCOL As String
    TPMRBase As String
    RePhoneNumLen As String
    ReP ......

浅议非Access数据库在VB中的编程及应用

Visual Basic有着强大的数据库存取能力,不仅能够直接支持Ms Access数据库,而且通过其内部安装的ISAM驱动程序使它能间接支持FoxPro、dBASE等外来数据库。本文不仅从VB数据库体系结构的角度探索了VB对这些外来数据库的支持,还结合了一些实例具体阐述了使用数据库存取对象变量的方法实现这些外来数据库的新建、库结构修改、 ......

VB中Shell和ShellExecute函数的使用方法和区别

 写了一个vb的程序,用来把原来写的几个vb和vc的程序整合起来。就是使用Shell函数。结果发现,vc的程序可以很好的显示,但vb写的却一运行就最小化了。仔细查看了一下以下文章,才发现原来shell函数的默认显示模式是windowstyle是等于vbMinimizedFocus。然后就是直接加上一个vbNormalFocus。一切ok!  
vb的s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号