torisch Posted June 10, 2003 Posted June 10, 2003 Is there a way I can get Visual Studio to tell me how many lines of code there is in a project/solution, or do I have to check each file my self, and sum the linecount for each file? -- Tor Inge Quote
Leaders dynamic_sysop Posted June 10, 2003 Leaders Posted June 10, 2003 '//Imports WindowsApplication1.Module1 << ignore Imports System.IO '///top of form's code window Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer Private Const EM_GETLINECOUNT As Integer = CInt(&HBA) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer Dim sr As StreamReader = New StreamReader(New FileStream("C:\Documents and Settings\den\My Documents\Visual Studio Projects\WindowsApplication1\Form1.vb", FileMode.Open), True) TextBox1.AppendText(sr.ReadToEnd.ToString()) i = SendMessage(TextBox1.Handle.ToInt32, EM_GETLINECOUNT, 0, 0) MsgBox(i) '/// i will return the line count of form1 sr.Close() End Sub you would have to repeat the procedure for each form :) i'm glad that worked :p Quote
nibsy Posted June 11, 2003 Posted June 11, 2003 Tools -> Options -> Text Editor -> All Languages -> General -> Line Numbers (checkbox) (Or am I missing the point :-\ ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.