Пример #1
0
        /// <summary>
        /// 获取需要拷贝的路径
        /// </summary>
        /// <returns></returns>
        public static List <CopyPath> GetPath()
        {
            string infoFile = _basePath + "\\UpdateConfig.xml";

            if (!File.Exists(infoFile))
            {
                return(null);
            }
            XmlDocument doc = new XmlDocument();

            doc.Load(infoFile);
            XmlNodeList     addinNodes = doc.GetElementsByTagName("Path");
            List <CopyPath> lstAddIn   = new List <CopyPath>();

            foreach (XmlNode node in addinNodes)
            {
                CopyPath     info = new CopyPath();
                XmlAttribute att  = node.Attributes["source"];
                if (att != null)
                {
                    info._sourcePath = att.InnerText;
                }
                att = node.Attributes["target"];
                if (att != null)
                {
                    info._targetPath = att.InnerText;
                }
                lstAddIn.Add(info);
            }
            return(lstAddIn);
        }
Пример #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            List <CopyPath> lst = CopyPath.GetPath();

            foreach (CopyPath cp in lst)
            {
                cp.DoCopy();
            }
            MessageBox.Show("¿½±´Íê±Ï");
        }