PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How to determine Available memory

Reply

How to determine Available memory

 
Thread Tools Rate Thread
Old 08-11-2007, 02:10 PM   #1
Ole
Guest
 
Posts: n/a
Default How to determine Available memory


How do I determine the available amount of memory in a Pocket PC (code
example)? I need to check if there is space enough for saving data before
doing it.

Thanks
Ole


  Reply With Quote
Old 08-11-2007, 03:17 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: How to determine Available memory

So, you don't want to know the amount of available memory, but the amount of
available disk space? I'm not sure that you will ever be able to reliably
predict ahead of time whether X is enough memory to save a file of size Y or
not. You have to deal with cluster sizes, just like you do on the desktop
when saving to disk. You can take a look at GetDiskFreeSpaceEx() in the C
SDK. You should be able to P/Invoke to that. Probably the 'right' way is
to just try to save and, if you get a disk-full exception, report that to
the user or take suitable automatic action as a result. I don't see
DriveInfo in .NET Compact Framework, so I think that P/Invoking is probably
going to be necessary.

Paul T.

"Ole" <ole@blabla.com> wrote in message
news:ODqYXEhIIHA.588@TK2MSFTNGP05.phx.gbl...
> How do I determine the available amount of memory in a Pocket PC (code
> example)? I need to check if there is space enough for saving data before
> doing it.
>
> Thanks
> Ole
>



  Reply With Quote
Old 08-11-2007, 03:52 PM   #3
nabeelfarid@gmail.com
Guest
 
Posts: n/a
Default Re: How to determine Available memory

On Nov 8, 2:10 pm, "Ole" <o...@blabla.com> wrote:
> How do I determine the available amount of memory in a Pocket PC (code
> example)? I need to check if there is space enough for saving data before
> doing it.
>
> Thanks
> Ole


Try OpenNETCF.IO.DriveInfo.AvailableFreeSpace in OpenNETCF 2.1
Framework. Its free if you are not aware of it

http://www.opennetcf.com/library/sdf/
http://www.opennetcf.com/Products/S...67/Default.aspx

Regards,
Nabeel

  Reply With Quote
Old 09-11-2007, 08:27 AM   #4
Ole
Guest
 
Posts: n/a
Default Re: How to determine Available memory

Thanks - GetDiskFreeSpaceEx does the job for me.

Ole


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:e6sRxohIIHA.4296@TK2MSFTNGP04.phx.gbl...
> So, you don't want to know the amount of available memory, but the amount
> of available disk space? I'm not sure that you will ever be able to
> reliably predict ahead of time whether X is enough memory to save a file
> of size Y or not. You have to deal with cluster sizes, just like you do
> on the desktop when saving to disk. You can take a look at
> GetDiskFreeSpaceEx() in the C SDK. You should be able to P/Invoke to
> that. Probably the 'right' way is to just try to save and, if you get a
> disk-full exception, report that to the user or take suitable automatic
> action as a result. I don't see DriveInfo in .NET Compact Framework, so I
> think that P/Invoking is probably going to be necessary.
>
> Paul T.
>
> "Ole" <ole@blabla.com> wrote in message
> news:ODqYXEhIIHA.588@TK2MSFTNGP05.phx.gbl...
>> How do I determine the available amount of memory in a Pocket PC (code
>> example)? I need to check if there is space enough for saving data before
>> doing it.
>>
>> Thanks
>> Ole
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off