frmProxy.frm
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:7k
源码类别:
浏览器
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmProxy
- BorderStyle = 4 'Fixed ToolWindow
- Caption = "代理设置"
- ClientHeight = 3855
- ClientLeft = 3570
- ClientTop = 3435
- ClientWidth = 6480
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3855
- ScaleWidth = 6480
- ShowInTaskbar = 0 'False
- Begin VB.ListBox lstOrder
- Height = 1035
- Left = 360
- TabIndex = 12
- Top = 1680
- Visible = 0 'False
- Width = 1455
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "取消"
- Height = 300
- Left = 5280
- TabIndex = 11
- Top = 3480
- Width = 1095
- End
- Begin VB.CommandButton cmdOk
- Caption = "确定"
- Height = 300
- Left = 4080
- TabIndex = 10
- Top = 3480
- Width = 1095
- End
- Begin VB.Frame Frame2
- Caption = "代理设置"
- Height = 3255
- Left = 2520
- TabIndex = 4
- Top = 120
- Width = 3855
- Begin VB.CommandButton cmdUpdata
- Caption = "更新(&U)"
- Height = 300
- Left = 2880
- TabIndex = 16
- Top = 2880
- Width = 855
- End
- Begin VB.CheckBox chkByPass
- Caption = "对于本地地址不使用代理服务器"
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 1080
- Width = 2895
- End
- Begin VB.TextBox txtByPass
- Height = 1095
- Left = 120
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 13
- Top = 1680
- Width = 3615
- End
- Begin VB.TextBox txtPort
- Height = 270
- Left = 3120
- TabIndex = 9
- Top = 600
- Width = 615
- End
- Begin VB.TextBox txtAddress
- Height = 270
- Left = 720
- TabIndex = 7
- Top = 600
- Width = 2295
- End
- Begin VB.TextBox txtName
- Height = 270
- Left = 720
- TabIndex = 5
- Top = 240
- Width = 3015
- End
- Begin VB.Label Label3
- Caption = "对于以下地址不使用代理服务器:"
- Height = 180
- Left = 120
- TabIndex = 15
- Top = 1440
- Width = 2700
- End
- Begin VB.Label Label2
- Caption = "地址:"
- Height = 180
- Left = 120
- TabIndex = 8
- Top = 600
- Width = 540
- End
- Begin VB.Label Label1
- Caption = "名称:"
- Height = 180
- Left = 120
- TabIndex = 6
- Top = 240
- Width = 540
- End
- End
- Begin VB.Frame Frame1
- Caption = "代理服务器列表"
- Height = 3255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2175
- Begin VB.CommandButton cmdDel
- Caption = "删除"
- Height = 300
- Left = 1200
- TabIndex = 3
- Top = 2880
- Width = 855
- End
- Begin VB.CommandButton cmdAdd
- Caption = "新增"
- Height = 300
- Left = 120
- TabIndex = 2
- Top = 2880
- Width = 855
- End
- Begin VB.ListBox lstProxyList
- Height = 2400
- Left = 120
- TabIndex = 1
- Top = 240
- Width = 1935
- End
- End
- End
- Attribute VB_Name = "frmProxy"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim tmpProxyData() As proxyType
- Dim tmpProxyDataCount As Integer
- Dim iniProxyData As proxyType
- Public IsCancel As Boolean
- Private Sub cmdAdd_Click()
- tmpProxyDataCount = tmpProxyDataCount + 1
- ReDim Preserve tmpProxyData(0 To tmpProxyDataCount)
- tmpProxyData(tmpProxyDataCount) = iniProxyData
- lstOrder.AddItem tmpProxyDataCount
- lstProxyList.AddItem "New Proxy"
- lstProxyList.ListIndex = lstProxyList.ListCount - 1
- With txtName
- .Text = "New Proxy"
- .SetFocus
- End With
- End Sub
- Private Sub cmdCancel_Click()
- IsCancel = True
- Me.Hide
- 'Unload Me
- End Sub
- Private Sub cmdDel_Click()
- If lstProxyList.ListIndex >= 0 Then
- Dim tmpIndex As Integer
- tmpIndex = lstProxyList.ListIndex
- lstOrder.RemoveItem tmpIndex
- lstProxyList.RemoveItem tmpIndex
- If lstProxyList.ListCount - 1 < tmpIndex Then tmpIndex = tmpIndex - 1
- If lstProxyList.ListCount > 0 Then
- lstProxyList.ListIndex = tmpIndex
- lstOrder.ListIndex = tmpIndex
- End If
- End If
- End Sub
- Private Sub cmdOk_Click()
- Dim i As Integer
- proxyDataCount = lstOrder.ListCount
- ReDim proxyData(0 To proxyDataCount)
- For i = 1 To proxyDataCount
- proxyData(i) = tmpProxyData(Val(lstOrder.List(i - 1)))
- Next
- IsCancel = False
- Me.Hide
- 'Unload Me
- End Sub
- Private Sub cmdUpdata_Click()
- If lstProxyList.ListIndex >= 0 Then
- With tmpProxyData(Val(lstOrder.List(lstProxyList.ListIndex)))
- .proxyName = Trim$(txtName)
- .address = Trim$(txtAddress)
- .port = Trim$(txtPort)
- .isByPass = chkByPass.Value
- .bypass = Trim$(txtByPass)
- lstProxyList.List(lstProxyList.ListIndex) = .proxyName
- End With
- End If
- End Sub
- Private Sub Form_Initialize()
- IsCancel = True
- With iniProxyData
- .address = vbNullChar
- .bypass = vbNullChar
- .isByPass = 0
- .port = vbNullChar
- .proxyName = "New Proxy"
- End With
- ReDim tmpProxyData(0 To proxyDataCount)
- tmpProxyDataCount = proxyDataCount
- End Sub
- Private Sub Form_Load()
- If proxyDataCount > 0 Then
- Dim i As Integer
- For i = 1 To proxyDataCount
- tmpProxyData(i) = proxyData(i)
- lstProxyList.AddItem tmpProxyData(i).proxyName
- lstOrder.AddItem i
- Next
- lstProxyList.ListIndex = 0
- End If
- End Sub
- Private Sub lstProxyList_Click()
- With tmpProxyData(Val(lstOrder.List(lstProxyList.ListIndex)))
- txtAddress.Text = RTrim$(.address)
- txtPort.Text = RTrim$(.port)
- txtName.Text = RTrim$(.proxyName)
- txtByPass.Text = RTrim$(.bypass)
- chkByPass.Value = .isByPass
- End With
- End Sub
- Private Sub txtName_GotFocus()
- With txtName
- .SelStart = 0
- .SelLength = Len(.Text)
- End With
- End Sub