Application Folder Properties

hcprogrammer

New member
Joined
Dec 11, 2008
Messages
2
Location
Austin, TX
Programming Experience
3-5
Is there a way to change what gets returned by Environment.SpecialFolder.CommonApplicationData?

For example, in my program this predefined property returns:

C:\Documents and Settings\All Users\Application Data\MyCompany\MySoftware\VersionNumber

I really do not need the version number on the end of this path. I know I could modify the path myself by truncating everything after the last '\', but I would like to see if there is a better way.

TIA for any help :)
 
Is there a way to change what gets returned by Environment.SpecialFolder.CommonApplicationData?
No, there isn't. You can use the DirectoryInfo class to get the parent folder name:
VB.NET:
pt = New IO.DirectoryInfo(pt).Parent.Name
 
No, there isn't. You can use the DirectoryInfo class to get the parent folder name:
VB.NET:
pt = New IO.DirectoryInfo(pt).Parent.Name

This is much better than what I was trying to do. I ended up with:
VB.NET:
file_path = New IO.DirectoryInfo(Application.CommonAppDataPath).Parent.FullName

Thanks! :)
 
Yes, that was supposed to be FullName... :eek:
 
Back
Top