Hi,

Can somebody tell how to write, read and format a MicrSD memory card using C sharp....I have checked Windows Embedded CE Developer Center but things are not getting clear....Please suggest me with an example..

Recommended Answers

All 5 Replies

I am unaware of any .NET framework support for formatting your SD card, but you could call the SHFormatDrive Function from your app, which will invoke the Shell's Format dialog, presumably as a child window because it requires a valid HWND.

As far as reading and writing, unless you intend to perform direct access, I don't believe you need to do anything special except perhaps pay attention to the remaining space. Just use the System.IO's File and Stream I/O classes.

Thank you for your suggestion.Actually I need to check memory cards by copying a file to it and reading that from memory card.Can I know whether any DLLs available for this "File and Stream I/O classes" so that I can easily use it in other programming languages also.
I used the dll shell32 for formating the drive.

Thank you for your suggestion.Actually I need to check memory cards by copying a file to it and reading that from memory card.Can I know whether any DLLs available for this "File and Stream I/O classes" so that I can easily use it in other programming languages also.
I used the dll shell32 for formating the drive.

As long as .NET framework is installed on the machine in question, you don't need to worry about the dll's; just check the minimum .NET version information for the functionality you wish to use: http://msdn.microsoft.com/en-us/library/k3352a4t.aspx

Hi, I worked with SHFormatdrive and its working fine the problem is its throwing the usual message boxes sch as "Format Local Disk(H:)" and the option for selecting "File system".. quick format...etc etc.... But i don't need any such interaction with the software.So when i click the start button my software will automatically format,write,read and format the memory card...ie while formatting the software should automatically format that particular memory card without throwing any message boxes...

Hi, I worked with SHFormatdrive and its working fine the problem is its throwing the usual message boxes sch as "Format Local Disk(H" and the option for selecting "File system".. quick format...etc etc.... But i don't need any such interaction with the software.So when i click the start button my software will automatically format,write,read and format the memory card...ie while formatting the software should automatically format that particular memory card without throwing any message boxes...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.