コード例 #1
0
 public Configuration()
 {
     String[] netdrives = runCmd("net", "use");
     foreach (String drive in netdrives)
     {
         NetDrive d = new NetDrive(drive);
         if (d.IsValid())
         {
             NetDrives.Add(d);
         }
     }
 }
コード例 #2
0
        public Boolean Load(String filename)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(filename);
            XmlNode node = xmlDoc.SelectSingleNode("NetDrives");

            foreach (XmlNode item in node.ChildNodes)
            {
                NetDrive n = new NetDrive();
                n.Error  += Load_Error;
                n.Output += Load_Output;
                n.Load(item);
                if (n.IsValid())
                {
                    NetDrives.Add(n);
                }
            }
            return(true);
        }