ArgusTV.Recorders.Common.ShareExplorer.IsValidLocalFilePath C# (CSharp) Method

IsValidLocalFilePath() public static method

public static IsValidLocalFilePath ( string fileName ) : bool
fileName string
return bool
        public static bool IsValidLocalFilePath(string fileName)
        {
            if (String.IsNullOrEmpty(fileName) || fileName.Length <= 2)
            {
                return false;
            }

            char drive = char.ToUpper(fileName[0]);
            if ('A' > drive || drive > 'Z')
            {
                return false;
            }
            else if (Path.VolumeSeparatorChar != fileName[1])
            {
                return false;
            }
            else if (Path.DirectorySeparatorChar != fileName[2])
            {
                return false;
            }
            return true;
        }