Retrieve Storage and Programs Memory on .NET Compact Framework 2 and WM5
        Posted  
        
            by wintermute
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by wintermute
        
        
        
        Published on 2010-02-05T19:12:41Z
        Indexed on 
            2010/05/16
            0:00 UTC
        
        
        Read the original article
        Hit count: 301
        
Hi!
I've been looking for quite a while already and still couldn't find a solution for this. All I need is to retrieve the memory levels and percentage of use. OpenNETCF has a MemoryManagement class, which seems to encapsulates a data structure returned through a P/Invoke or something like that, and it gives me the TotalPhysicalMemory, TotalVirtualMemory, AvailablePhisicalMemory and such, but those do not directly relate to Storage and Programs, nor could I find a way to "convert" these attributes to those I need.
Has anyone there already done this? It must be easy, I just need the very same values available on Settings > System > Memory.
Thanks in advance!
edit: I'm already being able to retrieve Available and total Storage memory through the GetDiskFreeSpaceEx P/Invoke. Since Storage and Programs memory seem to rely into the same hardware, maybe it's just a case of finding out what path to pass as the method's first parameter.
© Stack Overflow or respective owner