1.如何用vb得到网页的界面源代码
2.VB登陆窗体代码。数据库呢是源码源码用access的 数据库名为data 有一个登陆表 有两个字段名 用户名 密码
如何用vb得到网页的源代码
1 先加载网页:
Private Sub Form_Load()
WebBrowser1.Navigate "/question/.html"
End Sub
2 加载完成后取字符串到文本框:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim doc As Object, objhtml As Object
Dim strhtml As String
On Error GoTo errorsub
Me.Caption = WebBrowser1.LocationName & " 加载完成"
If MaxWebNum <= 0 Then
Set doc = WebBrowser1.Document
Set objhtml = doc.body.createtextrange()
If Not IsNull(objhtml) Then
strhtml = WebBrowser1.Document.body.innertext
Text1.Text = strhtml
End If
End If
Exit Sub
errorsub:
Text1.Text = "错误!!界面趋势分界指标源码!源码源码用"
End Sub
VB登陆窗体代码。界面gtk4源码数据库呢是源码源码用溯源码激光打标机access的 数据库名为data 有一个登陆表 有两个字段名 用户名 密码
新建vb工程,然后点击“工程”-->“引用”,界面在以下两个选项前挑勾:Microsoft Data Environment Instance 1.0
Microsoft ActiveX Objects 2.5 Library
因为你要用Access数据库,源码源码用所以需要在工程中添加控件。界面
建立Access数据库,源码源码用在这个vb工程文件夹新建一个文件夹,界面命名为table,源码源码用然后将这个Access数据库文件放入table文件夹中。界面每日风口预警源码
源代码:
Private Con_Access As Connections
Private Sub Form_Load()
Set Con_Access = New Connection
With Con_Access
.Provider = "microsoft.jet.oledb.4.0"
.ConnectionString = App.Path & "\table\ship.mdb"
.Open
End With
End Sub
Private Sub cmdOK_Click()
Dim cmd As New Command
Dim rd As New Recordset
cmd.ActiveConnection = Con_Access
cmd.CommandText = "select username,源码源码用userpassword from usertable where username='" & Text1.Text & "'"
On Error GoTo db_error
Set rd = cmd.Execute
On Error GoTo 0
If rd.EOF Then
MsgBox "用户名不存在。",界面二趋势指标源码 vbOKOnly + vbInformation, "错误"
Exit Sub
End If
db_error:
MsgBox Err.Description, vbOKOnly + vbInformation, "错误"
End Sub
Private Sub cmdCancel_Click()
End
End Sub
已经附上截图了,如果还有疑问,发电邮给我rearguard_zero@hotmail.com