2007年9月3日
摘要: 代码如下: 阅读全文
posted @ 2007-09-03 17:56 石川 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 我们在做网站时,为了版面的美观,通常一行只显示固定长度的字符串。一个汉字占用的宽度通常是一个英文字符的两倍。 static string getTitle(string str, int length) { if (Encoding.GetEncoding("GB2312").GetBytes(str).Length length) ... 阅读全文
posted @ 2007-09-03 17:55 石川 阅读(268) 评论(0) 推荐(0) 编辑