Exemple #1
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            //把监视的文件夹复制到目标文件夹
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                txtCopy.Text = fbd.SelectedPath;

                FileWatcherClass.CopyFile(txtPath.Text.Trim(), txtCopy.Text.Trim());
                System.Diagnostics.Process.Start("explorer.exe", txtCopy.Text.Trim());
            }
        }
Exemple #2
0
        private void btnSaveHis_Click(object sender, EventArgs e)
        {
            if (lvFiles.Items.Count == 0)
            {
                MessageBox.Show("没有数据");
                return;
            }
            string content = "";

            foreach (ListViewItem lvi in lvFiles.Items)
            {
                content += lvi.SubItems[0].Text + "\t";
                content += lvi.SubItems[1].Text + "\t";
                content += lvi.SubItems[2].Text;
                content += "\n";
            }
            FileWatcherClass.SaveHis(content);
        }