c# 文件备份

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AirPatientForm;
using AirwayCT.Entity;
namespace BuildPatients
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnInitial_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folder = new FolderBrowserDialog();
            folder.ShowNewFolderButton = true;
            folder.RootFolder = Environment.SpecialFolder.MyComputer;
            string selectPath = "";
            if (folder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                selectPath = folder.SelectedPath;
            }
            else
            {
                return;
            }

            RegistryDAO.CreateRegedit(selectPath);
           
            AirwayPatients p = AirwayPatients.Deserialize();
            AirwayPatients.Filename = selectPath + "\\AirwayPatients.xml";
            AirwayPatients.Serialize(p);     
        }
    }
}

 

posted @ 2013-03-21 20:17  louiskoo  阅读(457)  评论(0编辑  收藏  举报