WebAfter that, you can use the Directory.GetCurrentDirectory (); to get the path It will be the bin folder path of the project, but it's ok as the config file will be present in the bin folder. You can also use Environment.CurrentDirectory (); For best practice set the path as an environment variable. Share Improve this answer Follow WebCurrently I am using following function to get the temporary folder path for current user: string tempPath = System.IO.Path.GetTempPath (); On some machines it gives me temp folder path of current user like: C:\Documents and Settings\administrator\Local Settings\Temp\ On some machines it gives me system temp folder path like: …
c# - How do you get the current solution directory from a …
WebHow to get the Current Application Directory in C# ? The System.Environment.CurrentDirectory gets or sets a string that contains the current application directory. Below is sample code snippet demonstrating how to get the current application directory from a console application in C#. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 … WebAug 15, 2015 · Within your code, call the function System.IO.Directory.GetCurrentDirectory () By default, unless you've changed the Debug properties of your project, the current directory will start as the bin\Debug directory of your project (where the .exe runs from). Share Improve this answer Follow edited Sep 2, 2009 at 14:08 answered Sep 2, 2009 at … tribunals polity
Get Current Directory In C# - Code Like A Dev
WebNov 1, 2024 · C# using System; class GFG { static public void Main () { string resultPath = ""; resultPath = Environment.CurrentDirectory; Console.WriteLine ("System Directory:\n" + … WebMay 22, 2012 · The current directory isn't always the directory of your application. If it's a support file then it's not safe to assume this. – Adriano Repetti May 22, 2012 at 15:14 Incorrect! This is the current working directory, not the directory your project is being served from. – Meekohi Apr 14, 2024 at 19:48 Add a comment 0 WebJul 9, 2024 · Then, you can make use of Reflection to get Assembly paths like; string path = Assembly.GetAssembly(typeof (SomeClassInOtherProject)).Location; Solution 3. You should be able to … terengganu international air festival