For training related to .net,OOPS,design patterns, MVC,WCF and .net fundamentals
contact at sukeshmarla@gmail.com or Click Here

11 December 2010

Assembly Manifest

  • Every assembly, contains a collection of data that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly metadata
  • An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. 
  • The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information.
The following illustration shows the different ways the manifest can be stored.
Types of assemblies

A single-file assembly

Asp.net Cookies

What is Cookie?
When user visits a website for the first time a .txt file is sent to user's web browser and stored in a user system in a particular location, This text file is termed as cookie.

Use of cookie?
The main purpose of cookies is to know the user who visited websites. For instance, you can also save a small piece of information inside cookies.
You might have seen almost every website login page having one checkbox "Remember Me on this computer". These websites store the login information like username and password inside the cookies. So, next time when user logs in, the website retrieves the information from cookies and you will be logged in automatically.

Types of cookies:
1) Session Cookies: This cookie is stored temporary in the client machine. That means, when user closes the browser this session will be deleted from the client machine. This cookie is also called transient cookies.
2)Persistent Cookies: Persistent cookies is stored on the client hard drive in a particular location until it is not expired. That means persistent cookies hold the information until its expiry date and time.

Lets see how to work with cookies.
Like every Server side programming language ASP.NET also have Cookies class to deal with cookies.

To assign the value into cookies

HttpCookie myCookie = new HttpCookie("myCookie"); //Create the instance of HttpCookie class
myCookie.Values.Add("username", "MyUserName"); // Add Key and its value to Cookies
myCookie.Values.Add("password", "MyPassword"); // add Another key and value.

We have stored the value into cookies now we will see how to retirve value from cookies
To retrive the value from Cookies
HttpCookie cookie = Request.Cookies.Get("myCookie");
string UserName = cookie.Values["username"];
string Password = cookie.Values["password"];

NOTE : You should not store any critical information into cookies, as its visible and stored into client machine.