如何统计VS代码行数

最好的办法是使用VS中的ANALYZE菜单中Calculate Code Metrics for solution  ,会出现Code Metrics Results,里面统计了有效代码行数。 

 另一种方法:查找法

按下:Ctrl+Shift+F

在Find in Files中

Find what:中输入

b*[^:b#/]+.*$   

^b*[^:b#/]+.*$(去掉#、/或空行)

Look in:无需填

Find options中勾选

Use Regular Expressions

Look at these file types:中选择要统计代码的文件类型

点击Find All在Find Results1中最后有代码的总行数统计。

原文地址:https://www.cnblogs.com/syqun/p/lines.html