C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

C# Tip on 'Using'


Posted Date: 02 Mar 2004    Resource Type: Articles    Category: .NET Framework
Author: SasitharMember Level: Silver    
Rating: 1 out of 5Points: 10



The using keyword can be used to create an alias so that it is easier to qualify an identifier to a class or namespace.For example we use the WriteLine method of the Console class from the System namespace to print some output to the console.We can create a alias for the Console class so that we need not fully qualify it every time we use it.

The syntax for creating a alias is

using alias = class or namespace

The following example shows you how to create an alias for the Console class.

Example


using Con = System.Console; //creating an alias for the Console class
class Test
{
public static void Main()
{
Con.WriteLine("Hi DotNetSpiders");
}
}






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Migrating VB6.0 Application to VB.Net
Previous Resource: Using Params in C#
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use