Нотатка
Доступ до цієї сторінки потребує авторизації. Можна спробувати ввійти або змінити каталоги.
Доступ до цієї сторінки потребує авторизації. Можна спробувати змінити каталоги.
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
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.