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#”
Tag: C#
Microsoft Visual C# is simple, modern, general-purpose, object-oriented programming language, included in the Microsoft Visual Studio. Visual C# is also mostly used in ASP.NET web sites and Windows applications
How to check file permission to write in c#
If you need to check that sufficient permissions exist to write to file or not.The following code example shows the use of the FileIOPermission(FileIOPermissionAccess, String) constructor to create a new instance of the FileIOPermission class with the write access to the C:\test.txt file, Write access includes deleting and overwriting files or directories. Continue reading “How to check file permission to write in c#”
How to get the list of Running Applications in C#
This article demonstrates a very simple approach to finding out the list of the applications currently running on a machine.
We use the Process.GetProcesses() method to get the all processes that are currently running on your computer. Continue reading “How to get the list of Running Applications in C#”
Find the Error in following program – wrong casting in C#
Find the Error in following program-
Continue reading “Find the Error in following program – wrong casting in C#”
Identify the scope of the variables within a method in C#
Today we will discuss the scope of the variables within a method. We know that in c# we can declare local variables in any block, block refers the code between opening and closing curly braces or we can say that a block is begun with a opening curly brace and ended by a closing curly brace. Continue reading “Identify the scope of the variables within a method in C#”
Names of the various Data Types in Visual Basic .NET and Visual C#
Visual Basic and Visual C#, both have use the different syntax, here we can see the different names of the various data types in both languages. Continue reading “Names of the various Data Types in Visual Basic .NET and Visual C#”
Using string literals in C#
In C#, string is the set of the characters enclosed by double quote. Continue reading “Using string literals in C#”
The simple example of the partial class in c#
c# allow a new feature called partial classes. With partial classes, we can spread the definition of a class over multiple files.
The partial class definitions can be split up across multiple physical files. Continue reading “The simple example of the partial class in c#”
Struct in C#
You can encapsulate the small groups of related variables with the help of struct type. A struct type is a value type. Continue reading “Struct in C#”
Adding a DataTable to a DataSet in C#
In the C#, DataSet object is the set the more than one DataTables. You can add the multiple dataTables into the single DataSet object. You can set constraint information for a DataTable by using the PrimaryKey and Unique properties. Continue reading “Adding a DataTable to a DataSet in C#”