string regg = @"^[^\\/:\*\?""<>|]{1,120}$";
if (!Regex.IsMatch(command.NewName, regg))
{ Console.WriteLine("不合法");
}
else {
Console.WriteLine("合法");
}
string regg = @"^[^\\/:\*\?""<>|]{1,120}$";
if (!Regex.IsMatch(command.NewName, regg))
{ Console.WriteLine("不合法");
}
else {
Console.WriteLine("合法");
}
转载于:https://my.oschina.net/u/3911753/blog/1920947