devxlogo

Easily Access Files By Name in Windows Environment

Easily Access Files By Name in Windows Environment

Many programs access files either to read, write, or append data. For this the program needs to know where the physical file is located, besides the name of the file. There are many techniques to find out file location in the disk. You can use the MapPath() method in an IIS environment, put the files in the same directory from where the program is running, or opt to hard-code the path.

However, in a Windows environment, I always prefer to put the file in the system path (default is c:winntsystem32) so that Windows OS automatically finds the file by name. It makes the maintenance easy and has no overhead, as it is the default Windows behavior.

devx-admin

Share the Post: