aspx输出xml文件格式数据
代码Response.ContentType = "text/xml";
Response.Expires = -1;
Response.Charset = "utf-8";
Response.Clear();
string res = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><response><message>hello world</message></response>";
Response.Write(res);
Response.End();
Response.Expires = -1;
Response.Charset = "utf-8";
Response.Clear();
string res = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><response><message>hello world</message></response>";
Response.Write(res);
Response.End();
2、设置字符集-Response.Charset = "";//编码格式 ex:utf-8或gb2312
3、清空输入内容-Response.Clear();
4、构造XML内容并输出-Response.Write()



浙公网安备 33010602011771号