摘要: 项目中有一个地方需要检测用户的输入,而且客户要求不能输入中文。限制只能输入中文的方法比较多,主要是以下的方法:1、检测每个字符的Ascii ,判断是否在 255 以内;2、用正则表达式。eg: [^/x00-/xff]以下就是用 2 来实现的:using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;namespace ConsoleApplication1{ class Program { static void Main(string[] args 阅读全文
posted @ 2007-06-13 21:35 孤剑 阅读(197) 评论(0) 推荐(0) 编辑