有没有办法让在.net(C#)远程计算机的操作系统版本? 使用WMI是不能接受我。
Is there any way to get OS version of remote machine in .Net(C#)? Using of WMI is not acceptable for me.
我有远程计算机的IP地址:)和管理员凭据
I have IP address of remote machine :) and administrator credentials
根据一些usings sgmoore答案
based on sgmoore answer with some usings
public string GetOsVersion(string ipAddress)
{
using (var reg = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, ipAddress))
using (var key = reg.OpenSubKey(@"Software\Microsoft\Windows NT\CurrentVersion\"))
{
return string.Format("Name:{0}, Version:{1}", key.GetValue("ProductName"), key.GetValue("CurrentVersion"));
}
}