Form6.frm
资源名称:qq.rar [点击查看]
上传用户:luoweizhao
上传日期:2022-08-01
资源大小:1290k
文件大小:9k
源码类别:
外挂编程
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
- Begin VB.Form Form6
- BorderStyle = 1 'Fixed Single
- Caption = "HTTP代理设置"
- ClientHeight = 2175
- ClientLeft = 45
- ClientTop = 435
- ClientWidth = 5535
- Icon = "Form6.frx":0000
- LinkTopic = "Form6"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2175
- ScaleWidth = 5535
- StartUpPosition = 2 '屏幕中心
- Begin MSWinsockLib.Winsock Winsock1
- Left = 720
- Top = 1560
- _ExtentX = 741
- _ExtentY = 741
- _Version = 393216
- RemotePort = 10
- End
- Begin QQ伴侣.XPButton2 XPButton23
- Cancel = -1 'True
- Height = 375
- Left = 4440
- TabIndex = 7
- Top = 1680
- Width = 975
- _ExtentX = 1720
- _ExtentY = 661
- Caption = "关闭"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin QQ伴侣.XPButton2 XPButton22
- Default = -1 'True
- Height = 375
- Left = 3240
- TabIndex = 6
- Top = 1680
- Width = 975
- _ExtentX = 1720
- _ExtentY = 661
- Caption = "设置"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.Frame Frame1
- Height = 1455
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 5295
- Begin VB.TextBox Text4
- Height = 375
- IMEMode = 3 'DISABLE
- Left = 3360
- PasswordChar = "*"
- TabIndex = 11
- Top = 860
- Width = 1695
- End
- Begin VB.TextBox Text3
- Height = 390
- Left = 840
- TabIndex = 10
- Top = 860
- Width = 1695
- End
- Begin VB.CheckBox Check1
- Caption = "使用代理 (目前只支持HTTP 1.1代理)"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 0
- Width = 3375
- End
- Begin QQ伴侣.XPButton2 XPButton21
- Height = 375
- Left = 4080
- TabIndex = 5
- Top = 405
- Width = 975
- _ExtentX = 1720
- _ExtentY = 661
- Caption = "检查代理"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Verdana"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.TextBox Text2
- Alignment = 2 'Center
- Height = 325
- IMEMode = 3 'DISABLE
- Left = 3360
- TabIndex = 4
- Text = "808"
- Top = 420
- Width = 615
- End
- Begin VB.TextBox Text1
- Height = 325
- IMEMode = 3 'DISABLE
- Left = 840
- TabIndex = 2
- Top = 420
- Width = 1695
- End
- Begin VB.Label Label4
- Caption = "密码:"
- Height = 255
- Left = 2760
- TabIndex = 12
- Top = 960
- Width = 615
- End
- Begin VB.Label Label3
- Caption = "帐号:"
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 960
- Width = 735
- End
- Begin VB.Label Label2
- Caption = "端口:"
- Height = 255
- Left = 2760
- TabIndex = 3
- Top = 480
- Width = 615
- End
- Begin VB.Label Label1
- Caption = "地址:"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 480
- Width = 735
- End
- End
- End
- Attribute VB_Name = "Form6"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim test_temp As String
- Private Sub XPButton21_Click()
- On Error Resume Next
- Text1.Text = Trim(Text1.Text)
- Text2.Text = Trim(Text2.Text)
- Text3.Text = Trim(Text3.Text)
- Text4.Text = Trim(Text4.Text)
- If Len(Text1.Text) = 0 Or Len(Text2.Text) = 0 Then
- MsgBox "请填写代理的地址以及端口! ", 48, "提醒"
- Exit Sub
- End If
- Text1.Text = Replace(Text1.Text, "。", ".")
- test_temp = ""
- If Proxy = 1 Then '使用代理
- Winsock1.Close
- Winsock1.RemoteHost = Proxy_IP
- Winsock1.RemotePort = Proxy_DK
- Winsock1.Connect
- Else
- Winsock1.Close
- Winsock1.RemoteHost = Trim(Text1.Text)
- Winsock1.RemotePort = Val(Text2.Text)
- Winsock1.Connect
- End If
- End Sub
- Private Sub Winsock1_Connect()
- Dim strCommand As String
- Randomize Timer
- strCommand = "GET http://www.baidu.com/favicon.ico?" & Int(Rnd * 50000000 + 1) & " HTTP/1.1" & vbCrLf
- strCommand = strCommand + "Accept: */*" + vbCrLf
- If Len(Text3.Text) > 0 Or Len(Text4.Text) > 0 Then strCommand = strCommand & "Proxy-Authorization: Basic " & StrtoBase64(Text3.Text & ":" & Text4.Text) & vbCrLf
- strCommand = strCommand & "Host: www.baidu.com" & vbCrLf
- strCommand = strCommand & "Accept-Language: zh-cn" & vbCrLf
- strCommand = strCommand & "Connection: close" & vbCrLf
- strCommand = strCommand & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" & vbCrLf
- strCommand = strCommand & vbCrLf
- Winsock1.SendData strCommand '发送请求
- End Sub
- Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
- On Error Resume Next
- ReDim str(bytesTotal - 1) As Byte
- Winsock1.GetData str, vbArray + vbByte
- test_temp = test_temp & UTF8_Decode(str)
- End Sub
- Private Sub Winsock1_Close()
- Winsock1.Close
- If Len(test_temp) > 0 Then
- If InStr(test_temp, " 200 OK") > 0 Then
- MsgBox "代理服务器正常! ", 64, "成功提示"
- Else
- MsgBox "代理服务器连接错误! ", 48, "失败提示"
- End If
- test_temp = ""
- End If
- End Sub
- Private Sub XPButton22_Click()
- On Error Resume Next
- Dim ProxySZ As String
- Dim ProxyDK As String
- Dim ProxyU As String
- Dim ProxyP As String
- Text1.Text = Trim(Text1.Text)
- Text2.Text = Trim(Text2.Text)
- Text3.Text = Trim(Text3.Text)
- Text4.Text = Trim(Text4.Text)
- If Len(Text1.Text) = 0 Or Len(Text2.Text) = 0 Then
- MsgBox "请填写代理的地址以及端口! ", 48, "提醒"
- Exit Sub
- End If
- Text1.Text = Replace(Text1.Text, "。", ".")
- If Proxy <> Check1.value Then
- If Check1.value = 1 Then
- MsgBox "你启动了代理IP功能,请检查伴侣工作是否正常! ", 64, "成功提示"
- Else
- MsgBox "你关闭了代理IP功能! ", 64, "成功提示"
- End If
- End If
- Proxy = Check1.value
- Proxy_IP = Text1.Text
- Proxy_DK = Text2.Text
- Proxy_U = Text3.Text
- Proxy_P = Text4.Text
- ProxySZ = Proxy
- ProxyDK = Proxy_DK
- ProxyU = Proxy_U
- ProxyP = Proxy_U
- If Proxy = 1 Then
- SetProxy Proxy_IP, Proxy_DK, True '设置浏览器代理
- Else
- SetProxy Proxy_IP, Proxy_DK, False '设置浏览器代理
- End If
- If Len(Text3.Text) > 0 Or Len(Text4.Text) > 0 Then
- Basic = StrtoBase64(ProxyU & ":" & ProxyP)
- If Proxy = 1 Then WebBasic = "Proxy-Authorization: Basic " & Basic
- Else
- Basic = ""
- WebBasic = ""
- End If
- WritePrivateProfileString "Proxy", "ProxySZ", ProxySZ, App.Path & "Config.ini"
- WritePrivateProfileString "Proxy", "ProxyIP", Proxy_IP, App.Path & "Config.ini"
- WritePrivateProfileString "Proxy", "ProxyDK", ProxyDK, App.Path & "Config.ini"
- WritePrivateProfileString "Proxy", "ProxyU", ProxyU, App.Path & "Config.ini"
- WritePrivateProfileString "Proxy", "ProxyP", ProxyP, App.Path & "Config.ini"
- Form6.Visible = False
- End Sub
- Private Sub XPButton23_Click()
- Form6.Visible = False
- End Sub