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 / .NET Framework / Compact Framework / November 2007

Tip: Looking for answers? Try searching our database.

How to determine Available memory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ole - 08 Nov 2007 14:10 GMT
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
Paul G. Tobey [eMVP] - 08 Nov 2007 15:17 GMT
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.

> 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
Ole - 09 Nov 2007 08:27 GMT
Thanks - GetDiskFreeSpaceEx does the job for me.

Ole

> 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
[quoted text clipped - 15 lines]
>> Thanks
>> Ole
nabeelfarid@gmail.com - 08 Nov 2007 15:52 GMT
> 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/SmartDeviceFramework/CommunityEdition/tabid/67
/Default.aspx


Regards,
Nabeel

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.