File Handling in C#

Creating Objects In C#

Creating a DirectoryInfo or FileInfo object is very simple. The constructor takes the path to the file.   DirectoryInfo di = new DirectoryInfo(“C:\\Windows”); FileInfo fi = new FileInfo(“C:\\Windows\\Notepad.exe”);   Listing All Files in a Directory   The following code snippet lists all the files in the “C:\Windows” directory.   DirectoryInfo di = new DirectoryInfo(“C:\\Windows”); FileInfo[] …

Creating Objects In C# Read More »