yes, the keyCode for Chinese is between 0x4e00 (19968) and 0x9fa5 (40869):
if (/[\u4e00-\u9fa5]/.test(String.fromCharCode(event.keyCode)))
{
  alert("Chinese");
}

解决方案 »

  1.   

    1.只能输入数字和英文的:
    <input onkeyup="value=value.replace(/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
    2.只能输入数字的:
    <input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
    3.只能输入全角的:
    <input onkeyup="value=value.replace(/[^\uFF00-\uFFFF]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))">
    4.只能输入汉字的:
    <input onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))">
      

  2.   

    private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
    {
    if(char.IsNumber(e.KeyChar))//数字
              //char.IsDigit(e.KeyChar)带小数点的
              //char.IsLetter  字母
    {
    //your code;
    }
    }
      

  3.   

    <script language=javascript>
    /*判断当前字符是英文字符还是中文字符*/ 
    function ifWesternChr(chrInput) 
    {  
    var chrInput_e; 
    chrInput_e=escape(chrInput); 
    if(chrInput_e.length==(chrInput.length)*6 || chrInput==‘\r’ || chrInput==‘\n’) return false; /*只有非普通ASCII字符经过escape()函数编码之后的长度才会等于原长度的6倍,所以用这种方法可以避开内码直接判断当前字符是否为中文。*/ 
    else return true; 

    </script>
    用这个函数判断
      

  4.   

    呵呵,问题解决了,我用keycode判断,而且是在onkeydown事件中俘获键盘的keycode,可以使得用户只能输入数字,不用那么麻烦的判断中文的keycode