1. public string[] GetAllFilesInDirectory(string path, string pattern = "*.*", SearchOption options = SearchOption.TopDirectoryOnly)
    {
    if (path.Trim().Length == 0)
    return null; //Error handler can go here

    if ((pattern.Trim().Length == 0) || (pattern.Substring(pattern.Length - 1) == "."))
    return null; //Error handler can go here

    if (Directory.GetFiles(path, pattern).Length == 0)
    return null; //Error handler can go here

    return Directory.GetFiles (path, pattern, options);
    }
    0

    Add a comment

Blog Archive
Topics
Topics
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.