📄 global.asax
字号:
<%@ Import Namespace="System.Xml" %>
<Script Language="C#" runat="server">
public void Application_OnAcquireRequestState(Object sender, EventArgs e) {
XmlDocument dom = new XmlDocument();
string customerType;
// Grab the customerType from the QueryString
customerType = Request.QueryString["customerType"];
// Check for values
//if (customerType == null)
// customerType = "Bronze";
// Load the appropriate XML file
switch (customerType)
{
case "Gold":
dom.Load(Server.MapPath("Gold.xml"));
break;
case "Silver":
dom.Load(Server.MapPath("Silver.xml"));
break;
default:
dom.Load(Server.MapPath("Bronze.xml"));
break;
}
Session["WelcomeMsg"] = dom.SelectSingleNode("/customer/welcome").InnerText;
}
</Script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -