using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Text; using System.Data.SqlClient; using System.Collections.Generic; using System.Xml; namespace DSWeb.FeeCodes { public partial class TRANTYPEAdapter : System.Web.UI.Page { private string strMark; private string strPos; private int iPos = 0; public string strBSNO = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strPost = Request.Url.ToString(); if (Request.QueryString["mask"] != null) { strMark = Request.QueryString["mask"].ToString(); } if (Request.QueryString["pos"] != null) { strPos = Request.QueryString["pos"].ToString(); iPos = int.Parse(strPos); } XmlDocument docs = GetDoc(); Response.ContentType = "text/xml"; Response.Write(docs.OuterXml.ToString()); } } public string BuildXML() { StringBuilder resultBuilder = new StringBuilder(); resultBuilder.Append(""); resultBuilder.AppendFormat("", iPos == 0 ? string.Empty : " add=\"true\""); if (!string.IsNullOrEmpty(strMark)) { resultBuilder.AppendFormat("", "海运", "海运"); resultBuilder.AppendFormat("", "空运", "空运"); resultBuilder.AppendFormat("", "陆运", "陆运"); resultBuilder.AppendFormat("", "铁路", "铁路"); } resultBuilder.Append(""); return resultBuilder.ToString().Replace("&", "&"); } public XmlDocument GetDoc() { XmlDocument xmldoc = new XmlDocument(); string content = BuildXML(); try { xmldoc.LoadXml(content); } catch (Exception) { } return xmldoc; } } }