110,536
社区成员
发帖
与我相关
我的任务
分享
string getTLV(string tag, string content)
{
string len = System.Text.RegularExpressions.Regex.Replace(content, @"[^\x00-\xff]|[\xa4\xa7\xa8\xb0\xb1\xb7\xd7\xe0\xe1\xe8\xe9\xea\xec\xed\xf2\xf3\xf7\xf9\xfa\xfc]", "**").Length.ToString();
int size = len.Length;
for (int i = 0; i < 10 - size; i++)
{
len = "0" + len;
}
string tlv = tag + len + content;
return tlv;
}