CompactNav (Visual C#)
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

CompactNav (Visual C#) 

Visual Studio 2005

Download sample

The CompactNav sample is a Smartphone file-system browser written in managed code using version 1.0 of the .NET Compact Framework.

Security noteSecurity Note

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

  1. Click Download Sample.

    The File Download message box appears.

  2. Click Open, and on the left column of the zip folder window, click Extract all files.

    The Extraction Wizard opens.

  3. 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.

  4. 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.

  • Exception handling.

  • 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.

© 2016 Microsoft