home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / ClsView / global.asax < prev    next >
Encoding:
Text File  |  2000-06-23  |  1.1 KB  |  37 lines

  1. <%@ Import Namespace="System" %>
  2. <%@ Import Namespace="System.IO" %>
  3. <%@ Import Namespace="System.Data" %>
  4. <%@ Import Namespace="System.Data.XML" %>
  5. <%@ Import Namespace="System.Data.XML.DOM" %>
  6.  
  7. <script language="C#" runat=server>
  8.  
  9.     public void Session_OnStart(){
  10.         try{
  11.             string ClassViewPath = Server.MapPath("Assemblies.xml");
  12.  
  13.             // Create your XmlReader for the file
  14.             XmlReader XReader = new XmlReader(ClassViewPath);
  15.             
  16.             XmlDocument XMLDoc = new XmlDocument();
  17.             // XmlDocuments require an XmlReader to load if you don't have a DataSet.
  18.             // load the XmlReader for this file
  19.             XMLDoc.Load(XReader);
  20.  
  21.             // Get an XML DOM-based document -- party from here in the standard way.
  22.  
  23.             IDocument IDoc = XMLDoc.DomDocument;
  24.             IElement docElement = IDoc.documentElement;
  25.             INodeList Nodes = docElement.getElementsByTagName("Assembly");
  26.             ArrayList Assemblies = new ArrayList(Nodes.length);
  27.             
  28.             INode ThisNode = null;
  29.         }
  30.         catch(Exception Ex){
  31.             throw new Exception("Error has occurred in Session_OnStart.", Ex);
  32.         
  33.         }
  34.     }
  35.  
  36. </script>
  37.