If you want to to create a text file and write the text and if the file already exist then just append the text in the new line using C#, you can use the following code snippet in c#. Continue reading “Create or open text file to write the text in c#”
Tag: System.IO
Get the file name from the full path in VB.Net
In the below there are two methods that can be use to extract the file name from the full file path. Continue reading “Get the file name from the full path in VB.Net”
How to create and extract a zip archive by using the ZipFile class in C#
The following code snippet shows how to create a zip file of the folder by using ZipFile Class in c#. In .Net framework 4.5, C# includes a new class in System.IO.Compression.FileSystem. However before 4.5 we have been using GZipStream Class that Provides methods and properties used to compress and decompress streams. Continue reading “How to create and extract a zip archive by using the ZipFile class in C#”
Exclude specific files in file search with in a directory in C#
This article demonstrate how we can get the list of the files according specific search pattern with excluding some files. Suppose if a folder contains the following files: Continue reading “Exclude specific files in file search with in a directory in C#”