C# System.IO.DirectoryInfo Class
The ;class represents a directory in your file system. Its capabilities are similar to the ;class. You need to create an instance of DirectoryInfo class to make use of its properties…
C# System.IO.Directory Class
The ;class offers methods for creating, deleting, moving, retrieving file lists, and many more. These methods are static so you don’t need to create an instance of that class. The following…
C# System.IO.FileInfo Class
The ;class is quite similar to the ;class in that, they are used for the same purpose of manipulating a file. The difference is that FileInfo does not have static methods so you need…
C# System.IO.File Class
The ;class is a static class that exposes methods to manipulate an existing file in a directory. Such methods allow you to create, delete, open, move or copy a file. As…
Absolute and Relative Paths
Files and directories can be uniquely identified using their path names. Path names specify where files and directories are located. When specifying path names, you can either use an absolute…
C# File System
Most of the time, you will need to be able to write your data to files for permanent storage. You will also need to be able to access the file…
Validation Using Regular Expressions
Regular expression is a great way to validate data provided by a user to the fields of a form. Suppose that a user should input an age rather than a…
C# Regular Expressions
Sometimes when getting input from the user, you need to check if it follows a certain pattern. For example. consider a textbox that expects to get an email from the…
C# StringBuilder
The ;class can use the + operator to concatenate two strings. But this is inefficient when concatenating two different strings. The reason is that String objects in .NET are immutable, that is, the value cannot…
String Formatting
.NET provides you with ways to format the output of strings. You can use the ;to format your strings using different format specifiers. string str1 = "This"; string str2 = "That";…