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

  • 相关阅读:
    17. Letter Combinations of a Phone Number
    16. 3Sum Closest
    15. 3Sum
    14. Longest Common Prefix
    13. Roman to Integer
    12. Integer to Roman
    11. Container With Most Water
    10. Regular Expression Matching
    9. Palindrome Number
    8. String to Integer (atoi)
  • 原文地址:https://www.cnblogs.com/ouyangkai/p/10937981.html
Copyright © 2011-2022 走看看