Friday, January 13, 2017

Difference between EXE and DLL

In .NET framework, both .EXE and .DLL are called as assemblies. EXE stands for executable, and .DLL stands for Dynamic Link Library

EXE is an executable file and can run by itself as an application, where as .DLL is usually consumed by a .EXE or by another .DLL 

We cannot run or execute .DLL directly. 

For example, In .NET, compiling a Console Application or a Windows Application generates .EXE, where as compiling a Class Library Project or an ASP.NET web application generates .DLL. 


Verbatim string literal in C#


The "@" symbol is the verbatim string literal. 

Use verbatim strings for convenience and better readability when the string text contains backslash characters, for example in file paths. 

Because verbatim strings preserve new line characters as part of the string text, they can be used to initialize multiline strings. 

Use double quotation marks to embed a quotation mark inside a verbatim string. 

The following example shows some common uses for verbatim strings:


string ImagePath = @"C:\Images\Buttons\SaveButton.jpg";
Output: C:\Images\Buttons\SaveButton.jpg



string MultiLineText = @"This is multiline
Text written to be in
three lines.";

/* Output:
This is multiline
Text written to be in
three lines.
*/

string DoubleQuotesString = @"My Name is ""Prakash.""";
Output: My Name is "Prakash."