日期:2014-05-18  浏览次数:20910 次

c#中如何将字符串转化成GBK编码?
rt

------解决方案--------------------
C# code

Encoding.GetEncoding("GBK").GetString(Encoding.Default.GetBytes(str))

------解决方案--------------------
string s=""; 
byte[] buffer= Encoding.GetEncoding( "GBK "); .GetBytes(S); 
byte[] bUtf8=Encoding.Convert(Encoding.GetEncoding( "GBK"),Encoding.UTF8, buffer); 
Text =Encoding.UTF8.GetString(bUtf8);