Files
obsidian-life/mindmaps/Книга "Библия C-шарп" 4 глава.canvas
Aleksandr Ebaklakov 011626b8b7 Initial commit
2026-04-22 16:58:43 +03:00

41 lines
6.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"nodes":[
{"id":"21ec3ba27d17dc66","type":"text","text":"Консольные приложения![[Pasted image 20260114081444.png]]","x":-240,"y":-160,"width":456,"height":282},
{"id":"14560cb49281b536","type":"text","text":"Актуальность консоли","x":300,"y":-52,"width":255,"height":66,"color":"1"},
{"id":"eff6a09a3999447a","type":"text","text":"Для сетевых администраторов","x":600,"y":-240,"width":214,"height":96},
{"id":"694854c11912f817","type":"text","text":"Для выполнения задач в фоне","x":600,"y":-52,"width":263,"height":63},
{"id":"58b25ccaebe56e44","type":"text","text":"Кросплатформенность","x":600,"y":92,"width":250,"height":60},
{"id":"8670c0a455b8c82a","type":"text","text":"Ввод","x":-860,"y":-190,"width":250,"height":60},
{"id":"31cd68a691386ce6","x":-360,"y":-1020,"width":847,"height":700,"type":"text","text":"```c#\nusing System;\n\nclass Program\n{\n static void Main()\n {\n // 1. Заголовок окна\n Console.Title = \"Моя программа\";\n\n // 2. Цвет фона (на весь экран)\n Console.BackgroundColor = ConsoleColor.Blue;\n Console.Clear(); // Обязательно вызываем, чтобы закрасить всё окно\n\n // 3. Цвет текста\n Console.ForegroundColor = ConsoleColor.White;\n\n // 4. Вывод текста\n Console.WriteLine(\"Привет! Теперь консоль синяя, а текст белый.\");\n\n Console.ReadKey();\n }\n}\n```"},
{"id":"44ed721977acb139","type":"text","text":"Оформление","x":-61,"y":-270,"width":250,"height":60},
{"id":"538a913d422c2c52","type":"text","text":"Управление буфером и курсором","x":-102,"y":152,"width":250,"height":60},
{"id":"890dbae951bccfe4","type":"text","text":"Вывод","x":-735,"y":260,"width":250,"height":60},
{"id":"a34c44b13effbff0","x":-913,"y":-580,"width":490,"height":234,"type":"text","text":"Методы ввода\n```c#\nConsole.Write(\"Это \");\nConsole.Write(\"одна \");\nConsole.WriteLine(\"строка.\");\nConsole.WriteLine(\"А это уже новая.\");\n```"},
{"id":"b7ebb8aff4ae94d2","x":-1480,"y":-370,"width":520,"height":210,"type":"text","text":"Маски\n```c#\nint age = 25;\n// {0} заменится на значение переменной age\nConsole.WriteLine(\"Мне {0} лет\", age);\n```"},
{"id":"ee0da270360e4406","x":-1539,"y":-58,"width":679,"height":299,"type":"text","text":"Форматирование данных\n```c#\ndecimal price = 150.50m;\n// Выведет: Цена: 150,50 ₽ (зависит от настроек Windows)\nConsole.WriteLine(\"Цена: {0:C}\", price); \n\nint number = 255;\n// Выведет: FF\nConsole.WriteLine(\"В HEX: {0:X}\", number);\n```"},
{"id":"c71551ef755b406e","x":-1539,"y":323,"width":700,"height":210,"type":"text","text":"Чтение строки целиком\n```c#\nConsole.Write(\"Введите ваше имя: \");\nstring name = Console.ReadLine(); // Ждем ввода всей строки\nConsole.WriteLine(\"Привет, \" + name);\n```"},
{"id":"5a87e87d04658c3d","x":-1460,"y":620,"width":680,"height":233,"type":"text","text":"Чтение одного символа\n```c#\nConsole.WriteLine(\"Нажми любую клавишу:\");\nint code = Console.Read(); // Получаем код символа\nchar letter = (char)code; // Превращаем код в букву\nConsole.WriteLine(\"Вы нажали: \" + letter);\n```"},
{"id":"e98870242c47d20e","x":41,"y":290,"width":892,"height":545,"type":"text","text":"```c#\nusing System;\n\nclass Program\n{\n static void Main()\n {\n // 1. Устанавливаем позицию: 20-й символ слева, 10-я строка сверху\n Console.SetCursorPosition(20, 10);\n \n // 2. Печатаем текст именно в этой точке\n Console.WriteLine(\"Текст в центре экрана\");\n\n // 3. Можно скрыть или показать мигающий курсор\n Console.CursorVisible = false; \n\n Console.ReadKey();\n }\n}\n```"},
{"id":"8df896be99a487d2","x":-567,"y":384,"width":527,"height":316,"type":"text","text":"Цикличный ввод\n```c#\nstring input;\ndo {\n input = Console.ReadLine();\n Console.WriteLine(\"Вы ввели: \" + input);\n} while (input != \"q\"); // Повторяем, пока не введут \"q\"\n```"},
{"id":"96a7c97ae137d565","type":"text","text":"Работа с консолью","x":-610,"y":-52,"width":288,"height":74,"color":"1"}
],
"edges":[
{"id":"8f717a583f183ce3","fromNode":"21ec3ba27d17dc66","fromSide":"right","toNode":"14560cb49281b536","toSide":"left","color":"1"},
{"id":"48842f302f7b94a0","fromNode":"14560cb49281b536","fromSide":"top","toNode":"eff6a09a3999447a","toSide":"left"},
{"id":"16454ac067c002cf","fromNode":"14560cb49281b536","fromSide":"right","toNode":"694854c11912f817","toSide":"left"},
{"id":"18c4f09658672a2e","fromNode":"14560cb49281b536","fromSide":"bottom","toNode":"58b25ccaebe56e44","toSide":"left"},
{"id":"967e4b0f151b291e","fromNode":"21ec3ba27d17dc66","fromSide":"left","toNode":"96a7c97ae137d565","toSide":"right","color":"1"},
{"id":"d9c88ae95d1a8fbd","fromNode":"96a7c97ae137d565","fromSide":"top","toNode":"44ed721977acb139","toSide":"left"},
{"id":"e8727bb8a5bd4cb8","fromNode":"96a7c97ae137d565","fromSide":"bottom","toNode":"538a913d422c2c52","toSide":"left"},
{"id":"4b1e812ccfe65463","fromNode":"96a7c97ae137d565","fromSide":"left","toNode":"8670c0a455b8c82a","toSide":"right"},
{"id":"25e8e4a52e35e1b3","fromNode":"96a7c97ae137d565","fromSide":"left","toNode":"890dbae951bccfe4","toSide":"top"},
{"id":"11b5688a9ae6ac93","fromNode":"44ed721977acb139","fromSide":"top","toNode":"31cd68a691386ce6","toSide":"bottom"},
{"id":"224cfc6b7dc68c99","fromNode":"538a913d422c2c52","fromSide":"bottom","toNode":"e98870242c47d20e","toSide":"top"},
{"id":"3166110fb5ededce","fromNode":"8670c0a455b8c82a","fromSide":"top","toNode":"a34c44b13effbff0","toSide":"bottom"},
{"id":"b364849bc5b27804","fromNode":"8670c0a455b8c82a","fromSide":"left","toNode":"b7ebb8aff4ae94d2","toSide":"right"},
{"id":"3b41e3c9ff7bb3ab","fromNode":"8670c0a455b8c82a","fromSide":"bottom","toNode":"ee0da270360e4406","toSide":"right"},
{"id":"3f4c1a1b3a9674db","fromNode":"890dbae951bccfe4","fromSide":"left","toNode":"c71551ef755b406e","toSide":"top"},
{"id":"1d65d1d69d25c041","fromNode":"890dbae951bccfe4","fromSide":"bottom","toNode":"5a87e87d04658c3d","toSide":"right"},
{"id":"266acf49a82e800c","fromNode":"890dbae951bccfe4","fromSide":"bottom","toNode":"8df896be99a487d2","toSide":"top"}
]
}