Arkadaşlar dns değiştirici yaptım ancak dnsler bi türlü değişmiyor kodlarda nerde yanlışlık var acaba ?
Private Sub Command1_Click()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard In colNetCards
arrDNSServers = Array(Text1.Text, Text2.Text)
objNetCard.SetDNSServerSearchOrder (arrDNSServers)
Next
MsgBox ("DNS ler" + Chr(13) + Chr(10) + Text1.Text & " ve " & Text2.Text + Chr(13) + Chr(10) + "olarak değiştirildi...")
End
End Sub
Private Sub Form_Load()
Label1.Caption = "Yeğlenen Dns Sunucusu"
Label2.Caption = "Diğer DNS sunucusu"
Command1.Caption = "DNS Değiştir."
End Sub
Private Sub Command1_Click()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard In colNetCards
arrDNSServers = Array(Text1.Text, Text2.Text)
objNetCard.SetDNSServerSearchOrder (arrDNSServers)
Next
MsgBox ("DNS ler" + Chr(13) + Chr(10) + Text1.Text & " ve " & Text2.Text + Chr(13) + Chr(10) + "olarak değiştirildi...")
End
End Sub
Private Sub Form_Load()
Label1.Caption = "Yeğlenen Dns Sunucusu"
Label2.Caption = "Diğer DNS sunucusu"
Command1.Caption = "DNS Değiştir."
End Sub