visual-studio 在 Visual Studio 中启用行号显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2706910/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Enable the display of line numbers in Visual Studio
提问by Cyclone
Why doesn't Visual Studio have any way of showing line numbers in a source file? Is there any way to enable it, or a plugin for it? I know that the number of lines of code in a program doesn't matter, but sometimes it is nice to know how long a program is or the number of a particular line for reference.
为什么 Visual Studio 没有任何方式显示源文件中的行号?有什么方法可以启用它,或者它的插件?我知道程序中的代码行数并不重要,但有时知道程序的长度或特定行的数量以供参考是很好的。
Though I tried, I can't seem to find a way to enable line numbering and I find that surprising.
尽管我尝试过,但我似乎找不到启用行编号的方法,我觉得这令人惊讶。
This is Visual Studio 2010 Ultimate. (If you have read my older questions, I've been using 2008 Express until now.)
这是 Visual Studio 2010 Ultimate。(如果您已经阅读过我的旧问题,那么直到现在我一直在使用 2008 Express。)
回答by James McNellis
Visual Studio has line numbering:
Visual Studio 具有行编号:
Tools -> Options -> Text Editor -> All Languages -> check the "Line numbers" checkbox.
工具 -> 选项 -> 文本编辑器 -> 所有语言 -> 选中“行号”复选框。
回答by 0x6C38
As of Visual Studio 2015, you can find the option under:
从 Visual Studio 2015 开始,您可以在以下位置找到该选项:
Tools-> Options -> Text Editor -> All Languages-> General -> Line Numbers
Tools-> Options -> Text Editor -> All Languages-> General -> Line Numbers


Or simply go to tools -> optionsand type on the search bar: "Numbers".
或者干脆去tools -> options和键入的搜索栏:“数字”。
回答by Cyclone
Tools -> Options -> Show All Settings -> Text Editor -> All Languages -> Line Numbers
工具 -> 选项 -> 显示所有设置 -> 文本编辑器 -> 所有语言 -> 行号
回答by Abdessamad Doughri
回答by Dmitri Larionov
回答by Ya Basha
In VS 2010:
在 VS 2010 中:
Tools > Settings > Expert Settings
工具 > 设置 > 专家设置
Then:
然后:
Tools > Options > Show all settings > Text editor > C# > General > Check Line Numbers (checkbox)
工具 > 选项 > 显示所有设置 > 文本编辑器 > C# > 常规 > 检查行号(复选框)
回答by Sherif Hamdy
Visual studio 2015 enterprice
Visual Studio 2015 企业版
Tools -> Options -> Text Editor -> All Languages -> check Line Numbers
工具 -> 选项 -> 文本编辑器 -> 所有语言 -> 检查行号
回答by Wesam
回答by Seba Illingworth
Type 'line numbers' into the Quick Launch textbox (top right VS 2015), and it'll take you right where you need to be (tick Line Numbers checkbox).
在快速启动文本框(VS 2015 右上角)中输入“行号”,它会带你到你需要的地方(勾选行号复选框)。
回答by Martin Marconcini
Are you talking about seeing the line numbers or knowing the total number of lines in a project? Here is the 1st one
您是在谈论查看行号还是知道项目中的总行数? 这是第一个

