代码理解
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args){
string username1 = this.username.Text.ToString();
for (int i = 0; i < (int)username1.Length; i++)
{
string name = username1.Substring(i, 1);
if (name == "'" || name == "%" || name == "<" || name == ">" || name == "&" || name == "|")
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
}
请问这段怎么理解?
谢谢!