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