csharp windows application get current path

Code Example - csharp windows application get current path

                
                        System.IO.Path.GetDirectoryName(Application.ExecutablePath);
                    
                
 

get application path csharp

                        
                                System.Reflection.Assembly.GetExecutingAssembly().Location
                            
                        
 

csharp get application root path directory

                        
                                public static string GetApplicationRoot()
        {
            var exePath = new Uri(System.Reflection.
            Assembly.GetExecutingAssembly().CodeBase).LocalPath;
            return new FileInfo(exePath).DirectoryName;

        }