Tag: operating system

使用C#,如何获得我的机器是64位还是32位?

使用C#,我想创建一个方法来重新调整我的机器是64位还是32位。 有谁知道怎么做?

c#中的完整操作系统

我在这里看到了这个post。 我想知道这是否合法(听起来像这样)以及这样做的缺点是什么。 在一些架构中独立运行它需要什么? 谢谢

为WinForm应用程序分配控制台

我使用以下代码为WinForm应用程序分配控制台。 控制台窗口成功显示,输出就在那里。 但是当我关闭控制台窗口时,我的WinForm应用程序同时关闭。 为什么? 我想保留WinForm窗口。 private void btn_to_console_Click(object sender, EventArgs e) { if (NativeMethods.AllocConsole()) { lbl_console_alloc_result.Text = “Console allocation successfully!”; IntPtr stdHandle = NativeMethods.GetStdHandle(NativeMethods.STD_OUTPUT_HANDLE); Console.WriteLine(“from WinForm to Console!”); lbl_console_alloc_result.Text = Console.ReadLine(); } else lbl_console_alloc_result.Text = “Console allocation failed!”; } [System.Runtime.InteropServices.DllImportAttribute(“kernel32.dll”, EntryPoint = “GetStdHandle”)] public static extern System.IntPtr GetStdHandle(Int32 nStdHandle); /// Return Type: BOOL->int [System.Runtime.InteropServices.DllImportAttribute(“kernel32.dll”, EntryPoint […]

在WinRT Metro App C#中获取操作系统版本

我正在使用C#和Visual Studio 11 Beta编写Metro风格应用程序。 现在我想获得操作系统的操作系统版本。 我怎么能得到这个? 我发现了如何在“普通”应用程序中执行此操作。 在那里,您使用OSVersion属性获取Environment-Class,但在.NET Core中没有此属性

从c#中检测os语言

有没有办法从ac#class中检测操作系统的语言?