Exemple #1
0
        public static string[] GetDirectories(string applicationPath)
        {
            var paths = Directory.GetDirectories(AppPath.ConvertAppPathToAbsolutePath(applicationPath));

            for (var i = 0; i < paths.Length; i++)
            {
                paths[i] = AppPath.ConvertAbsolutePathToAppPath(paths[i].Replace('\\', '/'));
            }

            return(paths);
        }
Exemple #2
0
        public static string[] GetFiles(string applicationPath, string searchPattern = "*.*", SearchOption searchOption = SearchOption.TopDirectoryOnly)
        {
            var paths = Directory.GetFiles(AppPath.ConvertAppPathToAbsolutePath(applicationPath), searchPattern, searchOption);

            for (var i = 0; i < paths.Length; i++)
            {
                paths[i] = AppPath.ConvertAbsolutePathToAppPath(paths[i].Replace('\\', '/'));
            }

            return(paths);
        }
Exemple #3
0
 public static string ConvertToAppPath(string url)
 {
     return(AppPath.Join(GeneralSettings.WebRootPath, ConvertToActualUrl(url)));
 }
Exemple #4
0
 public static string ConvertAbsoluteAppPathToUrl(string absAppPath)
 {
     return(ConvertToVirtualUrl(AppPath.ConvertAbsolutePathToAppPath(absAppPath)));
 }
Exemple #5
0
 public static string ConvertToAbsolutePath(string url)
 {
     return(AppPath.Join(Program.RootPath, ConvertToAppPath(url)));
 }
Exemple #6
0
 public static async Task <string> ReadAllTextAsync(string appPath)
 {
     return(await File.ReadAllTextAsync(AppPath.ConvertAppPathToAbsolutePath(appPath)));
 }
Exemple #7
0
 public static string ReadAllText(string appPath)
 {
     return(File.ReadAllText(AppPath.ConvertAppPathToAbsolutePath(appPath)));
 }
Exemple #8
0
 public static bool Exists(string appPath)
 {
     return(File.Exists(AppPath.ConvertAppPathToAbsolutePath(appPath)));
 }
Exemple #9
0
 public static bool Exists(string applicationPath)
 {
     return(Directory.Exists(AppPath.ConvertAppPathToAbsolutePath(applicationPath)));
 }