You can determine that the current operating system is 64 bit OS or not.
In .NET Framework 4 there is one function Is64BitOperatingSystem is available to check that current operating system is a 64-bit operating system.
This function available in Environment class of System namespace.
This function return true if OS is 64 bit else return false.
Here is example :
This example is in both C# .Net Programming and VB.Net Programming.
C# Example :
VB.net Example :
This type of C# Tips is very useful in day to day programming life.
Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.
In .NET Framework 4 there is one function Is64BitOperatingSystem is available to check that current operating system is a 64-bit operating system.
This function available in Environment class of System namespace.
This function return true if OS is 64 bit else return false.
Here is example :
This example is in both C# .Net Programming and VB.Net Programming.
C# Example :
if (System.Environment.Is64BitOperatingSystem == true) { Response.Write("This is 64 Bit Operating System."); } else { Response.Write("This is not 64 Bit Operating System."); }
VB.net Example :
If System.Environment.Is64BitOperatingSystem = True Then Response.Write("This is 64 Bit Operating System.") Else Response.Write("This is not 64 Bit Operating System.") End If
This type of C# Tips is very useful in day to day programming life.
Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.
this is very useful. i did not know that it is so easy in .Net 4.0 to find OS is 64 bit or not.
ReplyDeletecan you also tell me how to detect processor is 64 bit or not?
Also looking forward more tips of .Net 4 which overcome issues faced in earlier version of .Net.
Hi Shashank,
ReplyDeleteI am keep finding new features of .Net 4.0 . As I get new features I will upload on this .Net Blog.
Excellent Blog, I appreciate your hard work , It is useful
ReplyDelete.NET Online Course Hyderabad