|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Obtain the folder where is the executable of my applicationapplicationj is installed. I want that path to find other files which are located related to the path where my application is installed. Is there antway to do this? For example i want to create a fileinfo object to retrieve the info of a file which is in the same folder as the executable of my application. I have tried to do this: FileInfo info=new FileInfo(".\\example.txt"); the problem with this is that when i create a FileInfo object passing an absolute path in its constructor FileInfo info=new FileInfo("c:\\Program Files\\Folder\\File.txt"); when i try later to create another fileinfo object to get another file in the same folder as my application executable FileInfo info=new FileInfo(".\\anotherexample.txt"); it throws me an exception because it cannot find "c:\Program Files\Folder\anotherExample.txt"; Hello, eduwushu!
System.Reflection.Assembly.GetEntryAssembly().Location "Vadym Stetsyak" <vady***@ukr.net> wrote in message andnews:ulAgJKQ0GHA.772@TK2MSFTNGP05.phx.gbl... > Hello, eduwushu! > > System.Reflection.Assembly.GetEntryAssembly().Location Directory.SetCurrentDirectory Show quote |
|||||||||||||||||||||||