System.IO.Path.GetInvalidPathChars C# (CSharp) Méthode

GetInvalidPathChars() public static méthode

public static GetInvalidPathChars ( ) : char[]
Résultat char[]
        public static char[] GetInvalidPathChars()
        {
            return PathInternal.GetInvalidPathChars();
        }

Usage Example

Exemple #1
0
        private async void CreateFolder(string folderName)
        {
            if (string.IsNullOrWhiteSpace(folderName))
            {
                MessageBox.Show("Invalid folder name");
                return;
            }
            List <char> invalidChars = Path.GetInvalidFileNameChars().ToList();

            invalidChars.AddRange(Path.GetInvalidPathChars().ToList());
            foreach (char c in invalidChars)
            {
                if (folderName.Contains(c))
                {
                    MessageBox.Show(string.Format("value '{0}' is invalid for name", c));
                    return;
                }
            }
            CreatingFolderTextBlock.Visibility = Visibility.Visible;
            try
            {
                await Utils.FTPMakeFolderAsync(string.Format("{0}{1}", FTPPath, folderName), Credential);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return;
            }
            FTPReturnFolderName = folderName;
            FTPReturnPath       = string.Format("{0}{1}/", FTPPath, folderName);
            DialogResult        = true;
            Close();
        }
All Usage Examples Of System.IO.Path::GetInvalidPathChars