VB显示网页源码或内容
http://blog.donews.com/sloo/archive/2006/01/29/711269.aspx
1.用Microsoft Internet Transfer Control 控件(在部件中添加),代码非常简单,如下(在form上添加一个Inet1和Text1和Command1):
Private Sub Command1_Click()
Text1.Text = Inet1.OpenURL("http://www.vbgood.com/")
End Sub
2.如果是使用 WebBrowser控件,代码也非常简单,如下(在form上添加一个WebBrowser1和Text1):
Private Sub Form_Load() WebBrowser1.Navigate2 "http://xsuplist.hintsoft.net/game/xsGame"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'显示源码
Text1.Text = WebBrowser1.Document.documentElement.outerHTML
''显示内容
'Text1.Text = WebBrowser1.Document.documentElement.outerTEXT
End Sub
VBS脚本:
Set oDOM = WScript.GetObject("http://baidu.com")
do until oDOM.readyState = "complete"
WScript.sleep 200
loop
WScript.echo oDOM.documentElement.outerText
相关文档:
'创建数据库
Private Sub Create(ByVal mdbPath As String)
If File.Exists(mdbPath) Then
Throw New Exception("目标数据库已经存在,无法创建")
......
简单
在Global.asa文件中加入如下的代码:
Java代码
1. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
2.
3. Sub Application_OnStart
4.
5. '当服务器开启时,设置在线用户计数器为0
6. Application("ActiveUsers") = 0
7.
......
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
......
3,Return without GoSub
5,Invalid procedure call
6,Overflow
7,Out of memory
9,Subscript out of range
10,This array is fixed or temporarily locked
11,Division by zero
13,Type mismatch
14,Out of string space
16,Expression too complex
17,Cant perform requested operation
18,User int ......