意大利甲組聯賽特别投注  怎么转码, 这些数据都是我从网上读取出来的。!!!

解决方案 »

  1.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Text.RegularExpressions;namespace WindowsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        public static string UnicodeToGB(string content)
            {
                Regex objRegex = new Regex("&#(?<UnicodeCode>[\\d]{5});", RegexOptions.IgnoreCase);
                Match objMatch = objRegex.Match(content);
                if (objMatch.Success)
                {
                    StringBuilder sb = new StringBuilder(content);
                    while (objMatch.Success)
                    {
                        string code = Convert.ToString(Convert.ToInt32(objMatch.Result("${UnicodeCode}")), 16);
                        byte[] array = new byte[2];
                        array[0] = (byte)Convert.ToInt32(code.Substring(2), 16);
                        array[1] = (byte)Convert.ToInt32(code.Substring(0, 2), 16);                    sb.Replace(objMatch.Value, Encoding.Unicode.GetString(array));                    objMatch = objMatch.NextMatch();
                    }
                    return sb.ToString();
                }
                else
                {
                    return content;
                }
            }        private void button1_Click(object sender, EventArgs e)
            {
                MessageBox.Show(UnicodeToGB("&#24847;&#22823;&#21033;&#30002;&#32068;&#32879;&#36093;&#29305;&#21035;&#25237;&#27880;"));
            }
        }
    }
      

  2.   

    添加web引用
    System.Web.HttpUtility.UrlDecode("")
      

  3.   


    实在太感谢了。   谢谢!!添加web引用
    System.Web.HttpUtility.UrlDecode("")  这个没有用。。 我试过了。