小编Wou*_*100的帖子

在C#控制台中从左侧填充

目前我正在尝试在控制台中打印一些信息,但我试图给所有结果提供相同的填充.

这里有一个例子,你可以看到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)

c# padding console-application

3
推荐指数
2
解决办法
4729
查看次数

基于输入和类的样式CSS

当类是'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)

谢谢

css css-selectors

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

标签 统计

c# ×1

console-application ×1

css ×1

css-selectors ×1

padding ×1