Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
The using keyword has two major uses:
- The
usingstatement defines a scope at the end of which an object is disposed:string filePath = "example.txt"; string textToWrite = "Hello, this is a test message!"; // Use the using statement to ensure the StreamWriter is properly disposed of using (StreamWriter writer = new StreamWriter(filePath)) { writer.WriteLine(textToWrite); } - The
usingdirective creates an alias for a namespace or imports types defined in other namespaces:using System; using System.IO;
See also
Comhoibriú linn ar GitHub
Is féidir foinse an inneachair seo a fháil ar GitHub, áit inar féidir leat fadhbanna agus iarratais ar tharraingt a chruthú agus a athbhreithniú. Chun tuilleadh faisnéise a fháil, féach ár dtreoir rannpháirtithe .