How would I always find the directory the application is in to direct a file read. I would need to make some call to return the application directory or is there some constant that would contain it?
-
-
That would depend upon your application. If you are doing a windows application for example you would use something like:
System.Windows.Forms.Application.ExecutablePath
-
15 hours ago,TDesigner wrote
How would I always find the directory the application is in to direct a file read. I would need to make some call to return the application directory or is there some constant that would contain it?
what are you working with ? Windows ? Linux ? Mac ?
C# ? C++ ? Visual Basic ?
for .net there are several pre defined paths that will point to common places for app data.
but if you are not using .net then that will not help. we need to knowwhat the environment is to give a good reply.
-
Thank you. I thought that there had to be a method. Finding it was another problem. It is invaluable to be able to access some experiance.
-
6 hours ago,TDesigner wrote
Thank you. I thought that there had to be a method. Finding it was another problem. It is invaluable to be able to access some experiance.
If you're not using WinForms, just use System.Reflection.Assembly.GetExecutingAssembly().Location or .GetEntrypointAssembly().
Add your 2¢