Technology

How to track the deleted folders in Windows Explorer in Windows Forms Application in C# .net

  You can track the deleted folders in Windows Application by using FileSystemWatcher Class. 1) First add System.IO.FileSystem.Watcher.dll  library. 2) Next Write the code as shown below. 3) If you need to track all the subdirectories which are deleted. The below code is important.   fileSystemWatcher.IncludeSubdirectories = true;   4) Write the source code as […]

Technology

How to check if directory exists in specified path and then create directory

The following code illustrates on how to check if directory exists in specific path, if not then create directory. Here I show that how to create the directory with simple condition.     private void TestDirectory() {     string pathname = “C:\\Myfolder”;         if(!Directory.Exists(pathname)) {     Directory.CreateDirectory(pathname); } }