Special Directories
Use this board to post your code snippets - tips and tricks
4 posts
Page 1 of 1
Hello,
Sometimes when designing an application you may want to access special folders on the users computer like "Desktop or My Documents" folders but because everyone has a different computer/user name it would be hard to know the location of the folder. VB includes generic code to locate these folders on any machine so for example if you needed to know the location of the users "My Documents" folder you can use this code to return its location:
Happy coding cooll;
Sometimes when designing an application you may want to access special folders on the users computer like "Desktop or My Documents" folders but because everyone has a different computer/user name it would be hard to know the location of the folder. VB includes generic code to locate these folders on any machine so for example if you needed to know the location of the users "My Documents" folder you can use this code to return its location:
Code: Select all
And the same for other folders:My.Computer.FileSystem.SpecialDirectories.MyDocuments
Code: Select all
Although those codes are short and simple they can make a big difference in your applications. For example I would say that most windows users keep there images in the default "My Pictures" folder so if you were making an image viewer/editor you could point it immediately to the My Pictures folder and load all the users pictures into your application. It saves the user hassle from having to manually navigate to the folder.My.Computer.FileSystem.SpecialDirectories.Desktop
My.Computer.FileSystem.SpecialDirectories.MyMusic
My.Computer.FileSystem.SpecialDirectories.MyPictures
My.Computer.FileSystem.SpecialDirectories.ProgramFiles
My.Computer.FileSystem.SpecialDirectories.Temp
Happy coding cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
could this locate the "app data/local" or "local/application data" for gaming mods locations
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

Here zach 
My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData

My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
Thanks CodenStuff this will really save us time for our apps. cooll;
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023