首页 > 编程 > .NET > 正文

asp.net直接Response输出WML页面示例代码

2024-07-10 13:15:23
字体:
来源:转载
供稿:网友

复制代码 代码如下:


protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/vnd.wap.wml";
StringBuilder builder = new StringBuilder();
builder.AppendLine("<?xml version=/"1.0/" encoding=/"UTF-8/" ?>");
builder.AppendLine("<!DOCTYPE wml PUBLIC /"-//WAPFORUM//DTD WML 1.2//EN/" /"http://www.wapforum.org/DTD/wml12.dtd/">");
builder.AppendLine("<wml>");
builder.AppendLine("<head>");
builder.AppendLine("<meta http-equiv=/"Cache-Control/" content=/"max-age=0/" />");
builder.AppendLine("</head>");
builder.AppendLine("<card /><br/>");
builder.AppendLine("<a href=/"/" title=/"部门机构/">部门机构</a><br/>");
builder.AppendLine("<a href=/"/" title=/"最新文件/">最新文件</a><br/>");
builder.AppendLine("");
builder.AppendLine(" </p></card>");
builder.AppendLine("</wml>");
Response.Write(builder.ToString());
Response.End();
}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表