⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.asax

📁 东软内部材料(四)asp等相关的教学案例 
💻 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 + -