string a="验证码字符串"
string b="要输入的字符串";
if (a.Equals(b, StringComparison.OrdinalIgnoreCase))
{
Response.Write("");
}
else
{
Response.Write("");
}
转换成大写或小写比较,如转换成小写:
string a = "用户输的";
string b = "验证码";
if(a.ToLower () == b.ToLower () )
{
//OK
}
string a = "用户输的";
string b = "验证码";
if(a.Equals(b, StringComparison.OrdinalIgnoreCase)
// 正确
statement..
else
// 错