![]() This.WindowState = FormWindowState.Minimized įolderWatch.Created = new FileSystemEventHandler(folderWatch_Created) įolderWatch.Renamed = new RenamedEventHandler(folderWatch_Renamed) įolderWatch.Deleted = new FileSystemEventHandler(folderWatch_Deleted) MessageBox.Show("Form Will Now Be Hidden in the Notify Area in the TaskBar","Form is Going to Be Hidden") Private void button2_Click(object sender, EventArgs e) Now for the Start Watching Button :-The Start watching button has the following code. if you want to show the form again just double click the icon.Ģ) Notify Me Of Changes :- Will show message boxes when changes occur inģ)Do Not Save Changes :-Will not save changes to the File. Now that the Path has been selected you can now click the "Start Watching"button.Before that you can check the options that you want to select.ġ) Hide and Watch :- Will hide the form and a icon will be placed in the Notify Area in the Task Bar. Private void button1_Click(object sender, EventArgs e)įolderBrowserDialog fbd = new FolderBrowserDialog() įbd.Description = "Choose a Folder to Watch" The Browse Button That is there Next to the TextBox shows a FolderBrowser Dialog which allows user to Choose the Folder to be Watched ,Once the user chooses the Folder the Path of the Folder gets displayed in the TextBox. I have declared two Boolean Variables to check whether the user has selected the Options to Show Notifications and to Save Changes to File. Public void SaveChangesToFile(string content) SaveChangesToFile :- This method will write the changes made to a File named "ntent" created in the C:\ drive.The code below shows the declaration of the SaveChangesToFile method.MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Information) Public void ShowMessageBox(string message, string caption) ShowMessageBox:- This method will show the MessageBox for any changes made in the folder.The code given shows the declaration of the method "ShowMessageBox".I have written Two Methods which do most of the notification Source Code Information : The folder watcher application is a very simple to develop application.īelow I have explained some of the important code that will be useful for you to understand the working of this application. Technical Information : It is made using the FileSystemWatcher component. Introduction : Initiotech's Folder Watcher is a Folder monitoring application that will keep on monitoring changes made to a Folder.IfĪny changes are made to the folder their will be a MessageBox notifing about the Change. Total Responses: 0 Posted By: Hefin Dsouza Member Level: Gold Points/Cash: 300 Simple Folder Monitor Application Using VB.Net Winforms
0 Comments
Leave a Reply. |