relate to dns search order.
http://support.microsoft.com/kb/311218
Const HKLM = &H80000002
sComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& sComputer & "\root\default:StdRegProv")
sKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Linkage"
sValueName = "Bind"
oReg.GetMultiStringValue HKLM, sKeyPath, sValueName, arValues
arValuesNew = Array()
'patch registry
If UCase(arValues(0)) <> UCase("\device\ndiswanip") Then
ReDim Preserve arValuesNew(0)
arValuesNew(0) = "\Device\NdisWanIp"
For Each objarValues in arValues
If UCase(objarValues) <> UCase("\device\ndiswanip") Then
ReDim Preserve arValuesNew(UBound(arValuesNew)+1)
arValuesNew(UBound(arValuesNew)) = objarValues
End If
Next
End If
If UBound(arValuesNew) <> -1 Then
oReg.SetMultiStringValue HKLM, sKeyPath, sValueName, arValuesNew
End If
2012年5月31日 星期四
2012年5月23日 星期三
2012年5月16日 星期三
2012年5月14日 星期一
run shell command and then display the result on web through asp.net via vb.net
Dim psi As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo
psi.FileName = "ipconfig.exe"
psi.Arguments = " /all"
psi.UseShellExecute = False
psi.RedirectStandardInput = True
psi.RedirectStandardOutput = True
Dim ps As System.Diagnostics.Process = New System.Diagnostics.Process
ps.StartInfo = psi
ps.Start()
Dim sr As StreamReader = ps.StandardOutput
Dim aa As String
While (Not sr.EndOfStream)
aa = sr.ReadLine
Response.Write(aa)
Response.Write("
")
End While
ps.Dispose()
訂閱:
文章 (Atom)