目前我正在尝试在控制台中打印一些信息,但我试图给所有结果提供相同的填充.
这里有一个例子,你可以看到CurrentBuildNumber结果有一个/ t到多./ t只是将所有内容对齐,它可能是其他任何内容.

所以,我需要一个"固定"填充:[结果].我怎样才能在我的代码中正确执行此操作?
谢谢!
码:
RegistryKey registryKeys = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion");
foreach (string registryKey in registryKeys.GetValueNames())
{
Console.WriteLine(registryKey + "\t\t: " + registryKeys.GetValue(registryKey));
}
Run Code Online (Sandbox Code Playgroud) 当类是'chatInput'时,是否有一种简单的方法可以防止使用样式.示例HTML:
<input type="button" value="hello" class="chatInput"/>
Run Code Online (Sandbox Code Playgroud)
和CSS类似:
input[type=button&class!=chatInput], input[type=submit&class!=chatInput]{
border: 1px solid grey;
padding: 2px 10px 2px 10px;
margin-top: 5px;
margin-bottom: 5px;
}
Run Code Online (Sandbox Code Playgroud)
谢谢