[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
Re: [2005 Express] App.Config Filepaths
What kind of Exception do you get?
Always be specific
Re: [2005 Express] App.Config Filepaths
Quote:
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?
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.