File System Watcher

Form Design


Source Code


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 System.IO;
namespace file_system_watcher
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e)
{
MessageBox.Show(String.Format("changed:{0}{1}", e.FullPath, e.ChangeType));
}
private void fileSystemWatcher1_Created(object sender, FileSystemEventArgs e)
{
MessageBox.Show(String.Format("created:{0}{1}", e.FullPath, e.ChangeType));
}
private void fileSystemWatcher1_Deleted(object sender, FileSystemEventArgs e)
{
MessageBox.Show(String.Format("deleted:{0}{1}", e.FullPath, e.ChangeType));
}
private void fileSystemWatcher1_Renamed(object sender, RenamedEventArgs e)
{
MessageBox.Show(String.Format("re named:{0}{1}", e.FullPath, e.ChangeType));
}
}
}

Output Screen



No comments:

Post a Comment

Techzmatrix