Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

How do I detect if my .net application is running in 64 bit mode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martijn Boven - 21 Aug 2006 14:26 GMT
Is there a function which returns is my application is in 64 bit mode?

-Martijn
Greg Young - 21 Aug 2006 14:41 GMT
I would imagine that you could just take the size of a reference (if 4 bytes
= 32 if 8 bytes = 64) although there might be a method somewhere that
already does this.

Cheers,

Greg

> Is there a function which returns is my application is in 64 bit mode?
>
> -Martijn
Nicholas Paldino [.NET/C# MVP] - 21 Aug 2006 15:05 GMT
You can just check the static Size property on the IntPtr class.

   Hope this helps.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>I would imagine that you could just take the size of a reference (if 4
>bytes = 32 if 8 bytes = 64) although there might be a method somewhere that
[quoted text clipped - 7 lines]
>>
>> -Martijn
Martijn Boven - 21 Aug 2006 15:18 GMT
That's smart. Thanks for the answer.

Greetings,
Martijn

>    You can just check the static Size property on the IntPtr class.
>
[quoted text clipped - 11 lines]
>>>
>>> -Martijn
Martijn Boven - 21 Aug 2006 15:26 GMT
btw this code works fine:

public static bool Is64BitMode()
{
       return System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr))
== 8;
}

> That's smart. Thanks for the answer.
>
[quoted text clipped - 16 lines]
>>>>
>>>> -Martijn

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.