在.NET 2.0 C#应用程序中,我使用以下代码来检测操作系统平台:
string os_platform = System.Environment.OSVersion.Platform.ToString();
Run Code Online (Sandbox Code Playgroud)
这将返回"Win32NT".问题是,即使在Windows Vista 64位上运行,它也会返回"Win32NT".
有没有其他方法可以知道正确的平台(32或64位)?
请注意,在Windows 64位上作为32位应用程序运行时,它还应检测64位.
我目前正在开发一个C#项目.我想收集用户统计信息以更好地开发软件.我正在使用Environment.OSC#的功能,但它只显示操作系统名称,如Microsoft Windows NT
我希望能够检索的是操作系统的实际已知名称,例如是否Windows XP, Windows Vista or Windows 7等等.
这可能吗?
我必须在C#Windows应用程序中检测Windows 8操作系统并进行一些设置.我知道我们可以使用Environment.OSVersion,但是如何检测Windows 8?
提前致谢.
使用Windows 10,从Windows 8升级=> 8.1 => 10当我使用此代码时.
OperatingSystem os = System.Environment.OSVersion;
Run Code Online (Sandbox Code Playgroud)
os.Version = {6.2.9200.0} System.Version
我想要正确的操作系统版本,因为我在Web服务上记录用户代理字符串,并且想要正确识别Windows版本以获得支持.什么是最简单的方法来正确报告正确的版本?
我想知道PC有哪个Windows版本..在C#Framework 3.5中
我试过用
OperatingSystem os = Environment.OSVersion;
版本ver = os.Version;
但结果是
Plataform:WIN32NT
版本6.2.9200
版本未成年人:2
版本专业:6
问题是我有"Windows 8 Pro"......
我该如何检测它?
谢谢
我有一段代码需要通过'网络提供.它非常适合具有HTTP API的AWS Lambda - 无状态,无副作用,相当CPU密集型功能,blob in,blob out.它是用C#/ .NET编写的,但它不是纯.NET,它使用UWP API,因此需要Windows Server 2016.
AWS Lambdas仅在Linux主机上运行,甚至在C#主机上运行.有没有办法以无服务器的方式在亚马逊云中部署这个部分 - 可能是Lambda以外的东西?我知道我可以使用EC2 VM,但这是无服务器架构的发明.
我将在c#中检查我的Windows操作系统名称(Windows 8 Pro)但是它出错了,出了什么问题?
RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion", true);
string currentKey;
currentKey = reg.GetValue("ProductName", true).ToString();
textBox1.Text = currentKey;
Run Code Online (Sandbox Code Playgroud)