日期:2014-05-18 浏览次数:21097 次
<%@ WebHandler Language="C#" Class="Handler2" %> using System; using System.Web; public class Handler2 : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/xml"; string s = "我"; string result=transfer(s); // u6211 context.Response.Write(result); } string transfer(string aa) { return "\u6211"; } public bool IsReusable { get { return false; } } }
char[] chs = s.ToCharArray(); string result = string.Empty; foreach (char c in chs) { result += char.ConvertToUtf32(c.ToString(), 0).ToString("x"); } return result;