日期:2009-05-13  浏览次数:20485 次

'Form1 窗体
Dim userID As String
Dim mobileNo As String
Dim checkRnd As String

Dim longin As Boolean
Dim checkRndBox As String
Public fileno As Variant
Dim ys As Integer
Dim su As Long
Dim sum As Long
Dim pas As String


Private Sub Check2_Click()
On Error GoTo err1
If Check2.Value Then
Open App.Path & "\" & Text9.Text For Input As #fileno

Else
Close #fileno
End If
Exit Sub
err1:
Stop
MsgBox "打开文件出错"
End Sub

Private Sub Command1_click()
On Error Resume Next
Dim allCol
Dim TagName As String
Dim allcount, i
Label2.Caption = "准备读取数据"
Set allCol = WebBrowser1.Document.All
allcount = allCol.length
For i = 0 To allcount - 1
TagName = allCol.Item(i).TagName
If "INPUT" = TagName Then
TagName = allCol.Item(i).Name
Select Case TagName
Case "userID"
userID = allCol.Item(i).Value
Case "mobileNo"
mobileNo = allCol.Item(i).Value
End Select
End If
Next
Timer5.Enabled = True
Exit Sub
End Sub
Private Sub Command2_Click()
Timer5.Enabled = True
End Sub

Private Sub Command3_Click()
Dim deskhdc&, ret&
Dim pxy As POINTAPI
deskhdc = GetDC(0)
pxy.x = Me.Left / Screen.TwipsPerPixelX + Picture1.Left
pxy.Y = Me.Top / Screen.TwipsPerPixelY + Picture1.Top + 17 + Val(Text1.Text)
deskhdc = BitBlt(Picture2.hdc, 0, 0, Picture1.Width + Val(Text3.Text), Picture1.Height + 6, deskhdc, pxy.x, pxy.Y, vbSrcCopy)
' Stop
ret = ReleaseDC(0&, deskhdc)
Picture2.Refresh

End Sub

Private Sub Command4_Click()
Dim i As Double
Dim Y As Integer
Dim deskhdc&, ret&
Dim pxy As POINTAPI
Dim pxy1 As POINTAPI
Dim pxy2 As POINTAPI
deskhdc = GetDC(0)
pxy.x = Me.Left / Screen.TwipsPerPixelX + Picture1.Left
pxy.Y = Me.Top / Screen.TwipsPerPixelY + Picture1.Top + 17
pxy1.x = Me.Left / Screen.TwipsPerPixelX + Picture1.Width + 5 + Picture1.Left
i = (pxy1.x - pxy.x) / 4
Select Case Val(Text1.Text)
Case 0
deskhdc = BitBlt(Picture2.hdc, 0, 0, i, Picture1.Height + 6, deskhdc, pxy.x + 2, pxy.Y, vbSrcCopy)
Case 1
deskhdc = BitBlt(Picture2.hdc, 0, 0, i, Picture1.Height + 6, deskhdc, pxy.x + i + 1, pxy.Y, vbSrcCopy)
Case 2
deskhdc = BitBlt(Picture2.hdc, 0, 0, i, Picture1.Height + 6, deskhdc, pxy.x + i * 2 + 1, pxy.Y, vbSrcCopy)
Case 3
pxy1.x = Me.Left / Screen.TwipsPerPixelX + Picture1.Width + Picture1.Left
i = (pxy1.x - pxy.x) / 4
deskhdc = BitBlt(Picture2.hdc, 0, 0, i + 2, Picture1.Height + 6, deskhdc, pxy.x + i * 3 + 3.5, pxy.Y, vbSrcCopy)
End Select
ret = ReleaseDC(0&, deskhdc)
Picture2.Refresh

End Sub

Private Sub Command5_Click()
Dim x1, y1 As Integer
Dim i As Integer
Dim h As Integer
Dim s As Long
Dim mu As Long
y1 = Picture2.ScaleHeight
'y2 = y1 * 7
x1 = Picture2.ScaleWidth
'x2 = x1 * 8
'================
For i = 1 To x1
For h = 1 To y1
DoEvents
' Stop
'8396800
If 0 = GetPixel(Me.Picture2.hdc, i, h) Then
s = s + 1
End If
Next h
Next i

Select Case s

'1 30
'2 36
'3 36
'4 36
'5 31
'6 4