CompactNav (Visual C#)
The CompactNav sample is a Smartphone file-system browser written in managed code using version 1.0 of the .NET Compact Framework.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.
To run this sample
Click Download Sample.
The File Download message box appears.
Click Open, and on the left column of the zip folder window, click Extract all files.
The Extraction Wizard opens.
Click Next. You can change the directory that the files will be extracted to, and then click Next again.
Make sure that the Show extracted files check box is selected, and then click Finish.
Double-click the sample's .sln file.
The sample solution is displayed in Solution Explorer. You might get a security warning that says the solution location is not trusted. Click OK to continue.
What the Sample Demonstrates
This sample illustrates how to implement a basic file-system navigator, including the following techniques:
Using Platform Invoke (pInvoke) to make calls to unmanaged APIs such as CreateProcess.
How to load images from the file system.
Executing executable files by selecting them using CreateProcess.
Entering directories by selecting them and pressing the action key.
Accessing parent directories by using a menu item (UpDir) or by selecting the conventional ".." directory.
Implementing a Quit option for testing convenience only, as they are not typical or recommended for real Smartphone applications.