public Configuration() { String[] netdrives = runCmd("net", "use"); foreach (String drive in netdrives) { NetDrive d = new NetDrive(drive); if (d.IsValid()) { NetDrives.Add(d); } } }
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); }