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();
    }

  • 相关阅读:
    【JS基础】数组
    【JS基础】循环
    【JS基础】DOM操作
    移动端字体
    【JQ基础】
    【JS基础】
    WebBrowser.DocumentText引发FileNotFound异常
    抽取网络信息进行数据挖掘 建立语料库
    文本分类和聚类有什么区别?
    C# 读取网页源代码
  • 原文地址:https://www.cnblogs.com/ouyangkai/p/10937981.html
Copyright © 2011-2022 走看看