VB登陆163邮箱
添加2个text,一个command,一个 WebBrowser
Dim vDoc, vTag
Dim i As Integer
Private Sub Command1_Click()
Set vDoc = WebBrowser1.Document
For i = 0 To vDoc.All.length - 1
If UCase(vDoc.All(i).tagName) = "INPUT" Then
Set vTag = vDoc.All(i)
If vTag.Type = "text" Then
Select Case vTag.Name
Case "username"
vTag.Value = Text1 '用户名
End Select
End If
If vTag.Type = "password" Then
Select Case vTag.Name
Case "password"
vTag.Value = Text2 '密码
End Select
End If
If vTag.Name = "remUser" Then '如果不要记住用户名,此句删除
vTag.Click
End If
If vTag.Type = "submit" Then '如果不要点击按钮登陆,把此if的代码删除
vTag.Click
End If
End If
Next i
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://mail.163.com/"
End Sub
相关文档:
Introduction
This article is about passing data between VB.NET/C# WinForms and JavaScript.
Before reading further, let me warn you that this article is not about ASP.NET. Concepts covered in the article are applied to Desktop applications.
Background
I was working on a project which required dat ......
Option Explicit
Private Const INTERNET_OPEN_TYPE_DIRECT = 1
Private Const scuseragent = "vb wininet"
Private Const INTERNET_FLAG_PASSIVE = &H8000000
'调用设置环境
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long ......
VB中 Replace 函数
描述
返回字符串,其中指定数目的某子字符串被替换为另一个子字符串。
语法
Replace(expression, find, replacewith[, compare[, count[, start]]])
Replace 函数的语法有以下参数:
参数 描述
expression 必选。字符串表达式,包含要替换的子字符串。
find 必选。被搜索的子字符串。
......
作者: 佚名, 出处:IT专家网, 责任编辑: 谢妍妍,
2010-04-23 11:20
本文介绍VB对程序运行的监控。
转眼间,本系列文章已经写到了第六个,今天写点什么呢?
还是得写,看似VB做不到的事情,那么今天起就写写VB对操作系统的控制吧。
首先,说一说,VB对于被调用后的程序的监控方法。
原型函数简 ......