system.Environment.MachineName 本机名称
但是去与用户名我不知道.NET里面怎么取,我倒是有个别的办法,通过nbtstat来取。
Try
p = New Process
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.CreateNoWindow = True
p.StartInfo.FileName = "nbtstat"
p.StartInfo.Arguments = "-A 127.0.0.1"
p.StartInfo.UseShellExecute = False
p.Start()
Result = p.StandardOutput.ReadToEnd
ret = True
Catch ex As Exception
ret = False
End Try