Tag Archives: .net

Best and Easy way to Convert CSV File to Excel File Using C#

By | 1st November 2019

The best and easiest way to convert csv file to excel file is here. This is the method I implemented and it is working fine. Hope you all implement it.   private void Convert_CSV_To_Excel(string filename)         {             // Rename .csv To .xls             System.IO.File.Move( filename , filename .Replace(“.csv”, “.xls”));             var _app = new MX.Application();             var _workbooks = _app.Workbooks;… Read More »

Defining Connection string in Notepad file and common method to connect to multiple databases

By | 23rd September 2019

Happy Coding Guys 🙂 The below is a notepad (.ini) file to define the connection string Below is the method to connect to multiple databases How to check if directory exists in specified path and then create directory How to Open dynamically specific extension file from a directory

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

By | 19th August 2019

  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… Read More »

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

By | 20th November 2017

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