how to write to file in program folder in VB.net?
ex
Program Files\n\n.ini.
how to write to n.ini in program folder.
xn hunk
-3
Light Poster
Recommended Answers
Jump to PostThe same way you'd write a file anywhere else. However, the Program Files folder is protected and may not be accessible depending on the user running the application. Impersonating a user with elevated privileges is kind of hairy, so the better approach would be to store your INI files in …
Jump to PostUse one of the following directories to store your data:
Dim userProfileDir As String = Environment.GetEnvironmentVariable("USERPROFILE") Dim allUsersProfileDir As String = Environment.GetEnvironmentVariable("ALLUSERSPROFILE") Dim appDataDir As String = Environment.GetEnvironmentVariable("APPDATA")
If you don't need to run your program on XP, you can use:
Dim appDataDir …
All 5 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
cgeier
187
Junior Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
xn hunk
-3
Light Poster
cgeier
187
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.