试试System.Web.UI.MobileControls.Link link1 = new System.Web.UI.MobileControls.Link();

解决方案 »

  1.   

    上面我搞错了下面是MSDN的代码,用法可以参照下列代码看看是否有错误,如果代码没有问题,应该是数据的问题。我估计很可能是代码有问题
    建议
    1)将一个字符串转化为ISO-8859-1后作为源,看你的程序能否正常转化为gb2312显示
    using System;
    using System.Text;namespace ConvertExample
    {
       class ConvertExampleClass
       {
          static void Main()
          {
             string unicodeString = "This string contains the unicode character Pi(\u03a0)";         // Create two different encodings.
             Encoding ascii = Encoding.ASCII;
             Encoding unicode = Encoding.Unicode;         // Convert the string into a byte[].
             byte[] unicodeBytes = unicode.GetBytes(unicodeString);         // Perform the conversion from one encoding to the other.
             byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes);
                
             // Convert the new byte[] into a char[] and then into a string.
             // This is a slightly different approach to converting to illustrate
             // the use of GetCharCount/GetChars.
             char[] asciiChars = new char[ascii.GetCharCount(asciiBytes, 0, asciiBytes.Length)];
             ascii.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0);
             string asciiString = new string(asciiChars);         // Display the strings created before and after the conversion.
             Console.WriteLine("Original string: {0}", unicodeString);
             Console.WriteLine("Ascii converted string: {0}", asciiString);
          }
       }
    }
      

  2.   

    主要还是GetEncoding用的编码不对