The following snippet gives a hint :
private void GetOSConfig()
{
string sProcess;
if (Environment.Is64BitOperatingSystem == true )
{
sProcess = "64 Bit";
}
{
sProcess = "32 Bit";
}
Console.WriteLine("OS is {0}", sProcess );
}
Subscribe to:
Post Comments (Atom)
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