This article is a mirror article of machine translation, please click here to jump to the original article.

View: 16333|Reply: 0

[Communication] C# using is used in three ways

[Copy link]
Posted on 2/20/2019 9:04:56 AM | | |
1.Using command.
using namespace name.
2.using aliases.
using alias = a specific type that includes detailed namespace information.
3. Using statement.

Define a scope that processes objects at the end of the scope.
Scenario:
When an instance of a class is used in a code snippet, and you want to automatically call the Dispose of the class instance as soon as it leaves the snippet, for whatever reason.
To achieve such an end, use try... Catching exceptions is also possible, but using is also convenient.







Previous:.NET core's parsing component, AngleSharp
Next:Moment.js JavaScript date handling class library
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com