a problem with path.getfullpath

Roma

Member
Joined
Dec 31, 2006
Messages
6
Programming Experience
Beginner
Hi!. The problem is that when i run my application, instaled with cab file on my PPC, the error is showed when Form1 is lodading: "File not found exception". I put msgbox(a) line to find out whats wrong..File q.dat location is "\program files\ponijs\q.dat" (program exe file location) but getfullpath returns a = "\q.dat". When i tried to use Application.startuppath instead of getfullpath, vb say that: "'StartUpPath' is not a member of 'System.Windows.Form.Application'". I find in internet that i must set "fileiopermissionAccess PathDiscovery" to allow getfullpath retrieving full path name of file system.. But i didn't find anywhere how to do it! :( Please write the code of correct permission "activization?" Sorry for my terrible english.

P.S.
I can't write just one constant path because installation folder can be changed in instalation process..

VB.NET:
[SIZE=2][COLOR=#0000ff]Imports[/COLOR][/SIZE][SIZE=2] System
[/SIZE][SIZE=2][COLOR=#0000ff]Imports[/COLOR][/SIZE][SIZE=2] System.IO[/SIZE]
[SIZE=2][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Form1_Load([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]MyBase[/COLOR][/SIZE][SIZE=2].Load
[/SIZE][SIZE=2]Dim a as string
a = Path.GetFullPath("q.dat")
MsgBox(a)
oRead = oFile.OpenText(a)
oRead.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][/SIZE]
 
Back
Top