Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

Pls some one tell that how and when we use interfaces in class in asp.net c#
like we want to create a login coding then i want to know how we generate and use ILogin interface in my asp.net c# programming.
Pls some one tell that how we create code in class file for ILogin Interface.

Thanks
Posted

 
Share this answer
 
 
Share this answer
 
.NET does not support multiple inheritances directly because in .NET, a class cannot inherit from more than one class. .NET supports multiple inheritances through interfaces.
for more..

Spam removed.
 
Share this answer
 
v2
Hii buddy...

Interfaces allow you to program against a "description" instead of a type, which allows you to more-loosely associate elements of your software.

Think of it this way: You want to share data with someone in the cube next to you, so you pull out your flash stick and copy/paste. You walk next door and the guy says "is that USB?" and you say yes - all set. It doesn't matter the size of the flash stick, nor the maker - all that matters is that it's USB.

In the same way, interfaces allow you to generisize your development. Using another analogy - imagine you wanted to create an application that virtually painted cars. You might have a signature like this:

public void Paint(Car car, System.Drawing.Color color)...

This would work until your client said "now I want to paint trucks" so you could do this:

public void Paint (Vehicle vehicle, System.Drawing.Color color)...

this would broaden your app... until your client said "now I want to paint houses!" What you could have done from the very beginning is created an interface:

public interface IPaintable{
void Paint(System.Drawing.Color color);
}

...and passed that to your routine:

public void Paint(IPaintable item, System.Drawing.Color color){
item.Paint(color);
}

Hopefully this makes sense - it's a pretty simplistic explanation but hopefully gets to the heart of it.

taken by this link for more information go throw this link...
http://stackoverflow.com/questions/122883/interfaces-why-cant-i-seem-to-grasp-them[^]
 
Share this answer
 
Comments
fjdiewornncalwe 25-Feb-13 9:00am    
Please don't add answers to old questions like this that already have answers.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900