ASP.Net C# "using" and inherit

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

In ASP.Net C# Windows Form, we have some lines which starts "using".
I am thinking when do I use a "using", and when should I use the inherit.
Any help will be appreciated.

Jason
 
Hello



It's strange for me, but how did you manage to mess ASP.NET application with
Win Form?



You are using "using" to add new namespaces. Also you can use the keyword
with disposable objects. Something like this:

using ( Pen pen = new Pen( ..) )

{
}

So, the pen will be automatically disposed, when you will out of the "using"
scope.



Inheritance is used for classes' inheritance, when you want to create a new
class on the base of existing one inheriting its functionality.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top