此範例是和區域內某一台的時間同步的方法:
參考引用:
Dim p As New System.Diagnostics.Process
Dim pinfo As New System.Diagnostics.ProcessStartInfo
Dim pout As String
pinfo.FileName = ("C:\WINDOWS\system32\net.exe")
pinfo.Arguments = ("time \\computername")
pinfo.RedirectStandardOutput = True
pinfo.UseShellExecute = False
pinfo.CreateNoWindow = True
p = Diagnostics.Process.Start(pinfo)
p.WaitForExit()
pout = p.StandardOutput.ReadLine
MsgBox(pout)
沒有留言:
張貼留言