private void GetOSConfig()
{
string sProcess;
if (Environment.Is64BitOperatingSystem == true )
{
sProcess = "64 Bit";
}
{
sProcess = "32 Bit";
}
Console.WriteLine("OS is {0}", sProcess );
}






















Visual Studio .NET Tips and Tricks, VB.NET Code Samples, C# Code Snippets, ASP.NET Code Samples, .NET Tips and Tricks, C# Tips & Tricks, Visual Studio 2010, .NET Framework Code Samples, VB.NET Tips & Tricks
It is returning 32-bit though my OS is Win7-64 bit. Can someone help me
ReplyDeletecorrection: you need to add the 'else' conditoion too:
ReplyDeleteThe following snippet gives a hint :
private void GetOSConfig()
{
string sProcess;
if (Environment.Is64BitOperatingSystem == true )
{
sProcess = "64 Bit";
}
else
{
sProcess = "32 Bit";
}
Console.WriteLine("OS is {0}", sProcess );
}
Its not worked in .net framework 3.5, missing 'Is64BitOperatingSystem' keyword.
Delete