访问的是TOMCAT上的webservice应用
返回了包含 "流星” 的xml
如果这些文字在html中将正常显示为中文字符: 流星
可是我做的是winform程序,请问如何在程序中实现这个转换过程,谢谢!
给思路或者代码都可以,代码无所谓c#或者vb.net,高分相酬,不够可加!感谢各位兄弟姐妹先
返回了包含 "流星” 的xml
如果这些文字在html中将正常显示为中文字符: 流星
可是我做的是winform程序,请问如何在程序中实现这个转换过程,谢谢!
给思路或者代码都可以,代码无所谓c#或者vb.net,高分相酬,不够可加!感谢各位兄弟姐妹先
27969就是流的ascii编码
我现在想知道的就是如何来实现这个转换过程,自己写函数的话,webservice返回的XML中可能中英文混杂,就麻烦了
想请教如何模拟IE识别html的过程……
{
webBrowser1.DocumentText =
"<html><body>Please enter your name:<br/>" +
"<input type='text' name='userName'/><br/>" +
"<a href='http://www.microsoft.com'>continue</a>" +
"</body></html>";
}
Response.Write(Server.HtmlDecode("&#27969;&#26143;"));winform:
引用System.Web.Dll
然后
HttpUtility.HtmlDecode("&#27969;&#26143;");
只是去掉了amp; 27969并未转换成汉字 流------------------------------------------------------
流星
---------------------------
确定
---------------------------
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Xml;namespace TestHtmlDecode
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click( object sender, EventArgs e )
{
string tempHTML = HttpUtility.HtmlDecode(this.textBox1.Text.Trim());
XmlDocument xmlDoc = new XmlDocument();
XmlElement xe = xmlDoc.CreateElement( "node" );
xe.InnerXml = tempHTML;
this.textBox2.Text = xe.InnerText;
}
}
}结果:输入: &#27969;&#26143;输出: 流星完毕,给分