其中包含两个检验字符匹配的函数
- public bool IsSafe (string str, int prama)
- {
- if (prama==1)
- {
- if (Regex.IsMatch(str,"[0-9]"))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- if (str.IndexOf("and")>0 || str.IndexOf("or")>0 || str.IndexOf("'")>0)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- }
转载于:https://blog.51cto.com/1358927/722502