|
-
Sep 18th, 2003, 01:18 PM
#1
Thread Starter
Member
This should be easier...
I've been professionally developing in VB since version 3 and I am finally trying to make the move to .NET (2003). I'm at a loss on something that should be easy.
I am working on a Pocket PC app that will store configuration data in an xml file.
How do I...
A). Get the application path?
B). Open the file?
I've tried this to get the current path but I get a "Not Supported" error:
Dim sDir As String
sDir = System.IO.Directory.GetCurrentDirectory.ToString()
Any help would be appreciated.
-
Sep 18th, 2003, 01:26 PM
#2
PowerPoster
1.)
Code:
Console.WriteLine(System.IO.Directory.GetCurrentDirectory().ToString())
2.) using the classes in the System.IO namespace (this is one way)
Code:
System.IO.FileStream s = new System.IO.FileStream("path", System.IO.FileMode.Open)
Last edited by Lethal; Sep 18th, 2003 at 01:33 PM.
-
Sep 18th, 2003, 02:01 PM
#3
Thread Starter
Member
I am writing this for Pocket PC so the console command won't work
When I try this code snippet:
MessageBox.Show(System.IO.Directory.GetCurrentDirectory().ToString())
I get:
"An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll"
This is a Pocket PC application so I'm assuming that this isn't supported in the Mobile Framework???
-
Sep 18th, 2003, 06:19 PM
#4
Frenzied Member
Are you using VS.NET to build this app? Some functions are not supported in the compact framework.
-
Sep 18th, 2003, 06:47 PM
#5
Thread Starter
Member
Yes, I'm using VS.NET 2003.
-
Sep 22nd, 2003, 09:46 AM
#6
Addicted Member
I could be totally off here, but...
In my little experience with PocketPC, there is no "traditional" directory structure, because there are no "drives", only the machine.
for example, a path on PocketPC would be
\My Documents
(no drive letter)
My guess is that certain IO operations aren't supported as a result
Here's a shot (pseudocode)
VB Code:
Dim asm As System.Reflection.Assembly
asm = System.Reflection.GetExecutingAssembly
sDir = asm.ExecutablePath
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|