asp.net C#如何实现验证码不区分大小写

2024-12-21 12:29:15
推荐回答(3个)
回答1:

string a="验证码字符串"
string b="要输入的字符串";
if (a.Equals(b, StringComparison.OrdinalIgnoreCase))
{
Response.Write("");
}
else
{
Response.Write("");
}

回答2:

转换成大写或小写比较,如转换成小写:

string a = "用户输的";
string b = "验证码";

if(a.ToLower () == b.ToLower () )
{
//OK
}

回答3:

string a = "用户输的";
string b = "验证码";

if(a.Equals(b, StringComparison.OrdinalIgnoreCase)
// 正确
statement..
else
// 错