Hi Guys,

I want to check the SD card rest memory.and also want to check if there
is a SD card or not on DOT NET ?

Is there any api there?

and how to implement it?

My enviroment is: CF2.0
VS2005

Thanks

Re: Check SD card Memory and by Krupa

Krupa
Wed Feb 14 13:37:19 CST 2007


I don't know of any APIs that would cater to your needs. However, you
can find out whether or not you have an SD card by doing

if(Directory.Exists(@"/Storage Card"))

You might as well check out DirectoryInfo class to see if it has any
memory related properties.

Krupa


Re: Check SD card Memory and by Arun

Arun
Wed Feb 14 15:02:10 CST 2007

Hi Jeff,
PInvoke GetDiskFreeSpaceEx to get the storage card free space, follow
Krupa's thread for checking the directory exist.

Code snippet:

[DllImport("coredll.dll")]
private static extern bool GetDiskFreeSpaceEx(string
lpDirectoryName,out ulong lpFreeBytesAvailableToCaller,
out ulong lpTotalNumberOfBytes,out ulong
lpTotalNumberOfFreeBytes);

Usage:
ulong freeBytesAvailable, totalBytesAvailable, freeBytesTotal;
if (GetDiskFreeSpaceEx(storagePath, out
freeBytesAvailable, out totalBytesAvailable, out freeBytesTotal) ==
true)
{
totalBytes = Convert.ToInt32(totalBytesAvailable);
availBytes = (int)freeBytesAvailable;
}

Hope this helps,
Cheers,
Arun
www.innasite.com


On Feb 14, 11:37 am, "Krupa" <krup...@gmail.com> wrote:
> I don't know of any APIs that would cater to your needs. However, you
> can find out whether or not you have an SD card by doing
>
> if(Directory.Exists(@"/Storage Card"))
>
> You might as well check out DirectoryInfo class to see if it has any
> memory related properties.
>
> Krupa



Re: Check SD card Memory and by ctacke/>

ctacke/>
Wed Feb 14 15:47:19 CST 2007

No, that folder is localized. Use FindFirstStorageCard()


--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


"Krupa" <krupa.p@gmail.com> wrote in message
news:1171481839.056069.230830@a34g2000cwb.googlegroups.com...
>
> I don't know of any APIs that would cater to your needs. However, you
> can find out whether or not you have an SD card by doing
>
> if(Directory.Exists(@"/Storage Card"))
>
> You might as well check out DirectoryInfo class to see if it has any
> memory related properties.
>
> Krupa
>