?? form1.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Configuracion de red"
ClientHeight = 2175
ClientLeft = 45
ClientTop = 435
ClientWidth = 4575
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2175
ScaleWidth = 4575
StartUpPosition = 3 'Windows Default
Begin VB.TextBox Text5
Height = 285
Left = 960
TabIndex = 10
Text = "80.58.61.250"
Top = 1680
Width = 1815
End
Begin VB.TextBox Text4
Height = 285
Left = 960
TabIndex = 8
Text = "62.37.228.20"
Top = 1320
Width = 1815
End
Begin VB.TextBox Text3
Height = 285
Left = 960
TabIndex = 6
Text = "255.255.1.2"
Top = 960
Width = 1815
End
Begin VB.TextBox Text2
Height = 285
Left = 960
TabIndex = 4
Text = "255.255.255.0"
Top = 600
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "Cambiar"
Height = 1815
Left = 2880
TabIndex = 1
Top = 240
Width = 1575
End
Begin VB.TextBox Text1
Height = 285
Left = 960
TabIndex = 0
Text = "64.233.161.144"
Top = 240
Width = 1815
End
Begin VB.Label Label4
Caption = "DNS2:"
Height = 195
Index = 1
Left = 120
TabIndex = 9
Top = 1680
Width = 480
End
Begin VB.Label Label4
Caption = "DNS1:"
Height = 195
Index = 0
Left = 120
TabIndex = 7
Top = 1320
Width = 480
End
Begin VB.Label Label3
Caption = "Gateway:"
Height = 195
Left = 120
TabIndex = 5
Top = 960
Width = 675
End
Begin VB.Label Label2
Caption = "Mask:"
Height = 195
Left = 120
TabIndex = 3
Top = 600
Width = 435
End
Begin VB.Label Label1
Caption = "IP:"
Height = 195
Left = 120
TabIndex = 2
Top = 240
Width = 195
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
strComputer = "."
Set objWMIService = CreateObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array(Text1.Text)
strSubnetMask = Array(Text2.Text)
strGateway = Array(Text3.Text)
strGatewaymetric = Array(1)
For Each objNetAdapter In colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable = 0 Then
MsgBox "
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -