get working directory csharp

Code Example - get working directory csharp

                
                        var DDIR = System.IO.Directory.GetCurrentDirectory();
var WorkingDirectory = "";
int index = DDIR.IndexOf(@"\");
if (index > 0)
	WorkingDirectory = DDIR.Substring(0, index) + @"\";
                    
                
 

csharp get current directory

                        
                                string currentDir = System.IO.Directory.GetCurrentDirectory();
//returns the current directory of the application when executing
                            
                        
 

get current directory csharp \

                        
                                System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                            
                        
 

csharp get script directory

                        
                                string appPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
                            
                        
 

get execution directory csharp

                        
                                string logsDirectory = Path.Combine(Environment.CurrentDirectory, "logs");
                            
                        
 

how to get current dir in csharp

                        
                                Environment.CurrentDirectory
                            
                        
 

csharp get project directory

                        
                                string wanted_path = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()));
                            
                        
 

csharp project path

                        
                                string startupPath = System.IO.Directory.GetCurrentDirectory();

string startupPath = Environment.CurrentDirectory;