DeadByDaylightBackup.Utility/FileUtility.cs
/// <summary>
/// Crude way to see if you may access a folder
/// </summary>
/// <param name="foldername">the folder to find</param>
/// <returns>true if its blacklisted, false if you may acces it</returns>
Crude way to see if you may access a folder
Crude way to see if you may access a folder
private static bool IsDirectoryBlacklisted(string foldername)
        {
            var name = foldername.Split('/', '\\').Last().Trim();
            if (name.Contains(".")) return true;
            if (name.StartsWith("_", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("Windows", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("AppData", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("ProgramData", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("Boot", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("Documents and Setting", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("K - Lite Codec Pack", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("config.msi", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("System Volume Information", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("df204f15c26da88c2b905180fb27acf7", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("vrpanorama", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("steamapps", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("dota2launcher", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("controller_base", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("bin", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("drivers", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("frameworks", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("(1)", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("(2)", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("(3)", StringComparison.OrdinalIgnoreCase)) return true;
            if (name.EndsWith("tenfoot", StringComparison.OrdinalIgnoreCase)) return true;
            return false;
        }
private static bool IsDirectoryBlacklisted ( string foldername ) { var name = foldername . Split ( ' ' , ' \\ ' ) . Last ( ) . Trim ( ) ; if ( name . Contains ( " " ) ) return true ; if ( name . StartsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; if ( name . EndsWith ( " " , StringComparison . OrdinalIgnoreCase ) ) return true ; return false ; }
Crude way to see if you may access a folder
Crude way to see if you may access a folder
true if its blacklisted, false if you may acces it
true if its blacklisted false if you may acces it
foldername
string
the folder to find
the folder to find