网上只找到WEB下通过JSP的全角半角切换.哪位大哥做过啊,指点下下

解决方案 »

  1.   

    public static bool YAGO_ChkByteLen(string strSrc,string strError)
    {
    int intN=0,intTemp=0;
    bool blnTemp=false;
    Encoding encValues = Encoding.Default;
    try
    {
    intN=strError.Length;
    intTemp=encValues.GetByteCount(strSrc);
    if(intTemp<=intN)
    blnTemp=true;
    else
    blnTemp=false;
    }
    catch(Exception ex)
    {
    strError=ex.Message.ToString();
    }
    return blnTemp;
    }