小编bob*_*bby的帖子

以重新说明声明为中心

我即将开始一个项目,这是我目前在欢迎屏幕上的内容.

string[] welcome = new string[4] 
{ 
    "Welcome", 
    "Choose A Option Bellow By Inputing The Number And Clicking Enter.", 
    "1. View C:\\Windows\\ File directory", 
    "2. View Your Own Custom Directory" 
};

string userChoice;
for (int x = 0; x < 4; x++)
{
    Console.WriteLine(
        "{0," + ((Console.WindowWidth / 2) + welcome[x].Length / 2) + "}", welcome[x]);
}
Run Code Online (Sandbox Code Playgroud)

我如何集中我的读取线?那么当用户选择他们的选择时也会居中?

c# console center readline console-application

1
推荐指数
1
解决办法
235
查看次数

标签 统计

c# ×1

center ×1

console ×1

console-application ×1

readline ×1