using System.Text.RegularExpressions;Match m = Regex.Match(string, @"^[\u4e00-\u9fa5]+$");
if(m.Success)
{
    //全中文
}
else
{
    //不是全中文
}

解决方案 »

  1.   

    Encoding gb2312=Encoding.GetEncoding("gb2312");
    string str;
    byte[] buf=gb2312.GetBytes(str);

    for(int i=0;i<buf.Length;)
    {
    if((buf[i]>128)&&(buf[i+1]>128))
    {
    MessageBox.Show("是汉字"); i+=2;
    } }
      

  2.   

    UnicodeEncoding unicodeEncoding = new UnicodeEncoding();
    byte [] unicodeByteArray = unicodeEncoding.GetBytes( inputString );
    for( int i = 0; i < unicodeByteArray.Length; i++ )
    {
    i++;
    //如果是中文字符那么高位不为0
    if ( unicodeByteArray[i] != 0 )
    {
    }
    ……
      

  3.   

    请问"^[\u4e00-\u9fa5]+$"表示什么意思?
      

  4.   

    to hikecn(hikecn)
    可能会是中文,也可能是其它字符
      

  5.   

    判断数字和字符:
    if ( !(((e.KeyChar >= (char)48) && (e.KeyChar <= (char)57)) || (e.KeyChar == (char)13) || (e.KeyChar == (char)8)))
    {

    // MessageBox.Show("输入错误,只能输入正整数");
    (sender as TextBox).Focus();
    e.Handled = true;
    }判断是否是汉字:
    用正则表达式吧
    Regex r= new Regex(@"[\u4e00-\u9fa5]+");
    MatchCollection m=r.Match(yourstring);