csharp get application root path directory

Code Example - 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;

        }
                    
                
 

get application path csharp

                        
                                System.Reflection.Assembly.GetExecutingAssembly().Location
                            
                        
 

csharp windows application get current path

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