/// <summary>
/// 截取字符串函数
/// </summary>
/// <param name="Str">所要截取的字符串</param>
/// <param name="Num">截取字符串的长度</param>
/// <returns></returns>
public static string GetSubString(string Str, int Num)
{
if (Str == null || Str == "")
return "";
string outstr = "";
int n = 0;
foreach (char ch in Str)
{
n += System.Text.Encoding.Default.GetByteCount(ch.ToString());
if (n > Num)
break;
else
outstr += ch;
}
return outstr;
}