zoukankan      html  css  js  c++  java
  • 文件监听

    private void button1_Click_1(object sender, System.EventArgs e)
    {
    if(this.folderBrowserDialog1.ShowDialog()==DialogResult.OK)
    {
    if(this.folderBrowserDialog1.SelectedPath.Trim()!="")
    {
    this.textBox1.Text=this.folderBrowserDialog1.SelectedPath.Trim();
    }
    }
    }

    private void button2_Click(object sender, System.EventArgs e)
    {
    if(!System.IO.Directory.Exists(this.textBox1.Text))
    {
    MessageBox.Show("",MessageBoxButtons.OK,MessageBoxIcon.Information);
    return;
    }
    this.fileSystemWatcher1.Path=this.textBox1.Text;
    MessageBox.Show(this.textBox1.Text+"",MessageBoxButtons.OK,MessageBoxIcon.Information);

    }

    private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e)
    {//
    this.richTextBox1.Text+=e.FullPath.ToString()+" ";
    }

    private void fileSystemWatcher1_Created(object sender, System.IO.FileSystemEventArgs e)
    {//
    this.richTextBox1.Text+=""+e.FullPath.ToString();
    }

    private void fileSystemWatcher1_Deleted(object sender, System.IO.FileSystemEventArgs e)
    {//
    this.richTextBox1.Text+=" "+e.FullPath.ToString();
    }

    private void fileSystemWatcher1_Renamed(object sender, System.IO.RenamedEventArgs e)
    {//
    this.richTextBox1.Text+=" "+e.FullPath.ToString();
    }

  • 相关阅读:
    弱网测试—Network-Emulator-Toolkit工具
    chmod修改权限
    mysql:on duplicate key update与replace into
    mysql:批量更新
    linux:磁碟与档案系统管理
    linux:指令与档案的搜索
    linux:问题
    linux:档案与目录管理
    linux:档案权限
    linux:习惯
  • 原文地址:https://www.cnblogs.com/ouyangkai/p/10937981.html
Copyright © 2011-2022 走看看