|
-
Oct 4th, 2006, 12:36 PM
#1
Thread Starter
New Member
[RESOLVED] [2005 Express] App.Config Filepaths
Hello,
I have tried using
Code:
System.Diagnostics.Process.Start(My.Settings.pathhmt)
Where pathhmt is a path to an EXE file, but unfortunatly the file does not load and I get an exception.
How can I launch a file with the filepath referenced in the app.config?
Thanks in advance.
Ajhayter
Last edited by Ajhayter; Oct 4th, 2006 at 12:37 PM.
Reason: oops title
-
Oct 4th, 2006, 02:47 PM
#2
Re: [2005 Express] App.Config Filepaths
What kind of Exception do you get?
Always be specific
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Oct 4th, 2006, 02:54 PM
#3
Thread Starter
New Member
Re: [2005 Express] App.Config Filepaths
 Originally Posted by ComputerJy
What kind of Exception do you get?
Always be specific
Just a file cannot be found in the debug.
Seems to be it just searches for "my.settings.pathhmt" rather than the filepath that "pathhmt" references.
Any ideas?
-
Oct 4th, 2006, 05:52 PM
#4
Re: [2005 Express] App.Config Filepaths
Have you actually checked what that setting contains? The code you've provided will work fine as long as the setting contains a valid file path. If it doesn't then of course you're going to get an exception. The only way that that code would search for a file named "My.Settings.pathhmt" is if you'd wrapped it in double quotes, which you haven't according to your post.
VB Code:
If IO.File.Exists(My.Settings.patthmt) Then
MessageBox.Show("File found: " & My.Settings.patthmt)
Else
MessageBox.Show("File not found: " & My.Settings.patthmt)
End If
Don't just assume that everything you think is happening is happening. Test it.
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
|