Torna al Thread

[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool IsWow64Process( [In] IntPtr hProcess, [Out] out bool wow64Process ); public static string CurrentVersionSO() { //Ottine la versione del sistema operativo (32 o 64 bit) try { Process p = Process.GetCurrentProcess(); IntPtr handle = p.Handle; bool isWow64; bool risultato = IsWow64Process(handle, out isWow64); if (risultato == true) { return "64"; } else { return "32"; } } catch (Exception) { return "32"; } }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5