Back to VSLive! San Francisco Show Daily Home
.NET Compact Framework Tips
Understand the Pocket PC file system, and find out where your app is running.
by Andy Wigley
VSLive! San Francisco, February 13, 2003
Note: Andy Wigley is presenting "Building Mobile Apps Quickly" at VBITS San Francisco, Thursday, February 13. These tips are from that session.
Understanding the Pocket PC File System
The different file system is one thing that trips up desktop developers moving over to .NET Compact Framework development for Pocket PCs. There are no drives on Windows CE-based devices. The root of the file system is '\', so typically your application will be installed to a directory like '\Program Files\MyApplication'. If your device has a storage card, then the root folder on the card is '\Storage Card'.
Find Out Where Your Application is Running
If your application is installed to different locations, and you need to open a file in the startup directory, then you need to know where your application was started. To do this in the .NET Compact Framework, use this code:
Dim appURL as String = _
System.Reflection.Assembly. _
GetExecutingAssembly().GetName().Codebase
Dim folder as String = new _
System.IO.FileInfo(appURL).DirectoryName
About the Author
Andy Wigley is a Principal Technologist at U.K. technical authoring company Content Master, focusing on mobile technologies. He is an expert in the use of the Microsoft .NET Framework in mobile solutions. He is the co-author of Building .NET Applications for Mobile Devices, and is lead author of the .NET Compact Framework Developer's Reference. Reach Andy at andyw@contentmaster.com.
Back to top
|