count the number of lines of code in a file, excluding blanks and comments also Count How many classes, Count How many function or procedures, how many lOC in each function or class, Count the lOC in each part to get the total program size ?

Question: How to get help on DaniWeb?

Answer: Show us that you have done something more than just copying your homework question here. Show us your code, and where you are getting stuck, and someone will help you.

Comments
I think it and you post it!

I have been done with this code but how to count class & funcation !

'Visual basic (.NET)
'Define library for read files
Imports System.IO
Public Class ETable1
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
'Identifier variable for file path that the user selects
Dim x As String
Try
'Choose text file
OpenFileDialog1.Filter = "TIFF(*.txt;*.txt)|*.txt"
'If user choose text file the code will be run
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
'Store file path
x = OpenFileDialog1.FileName
'Identifier variable for store lines value
Dim lines() As String = IO.File.ReadAllLines(x)
'Delete data from list
ListBox1.Items.Clear()
'Read files from text file
ListBox1.Items.AddRange(lines)
End If
Catch ex As Exception
'If file doesn't chooses or not found
MsgBox("file not found &   check the filename and try again", vbCritical)
End Try
'Identifier variable for store lines count
Dim DCount As Integer
'Identifier variable for store lines count value
Dim Row As String = ""
'Identifier variable for read file
Dim CSVReader As System.IO.StreamReader 'Puts file in CSVReader for Sorting
'Store file in Identifier variable
CSVReader = System.IO.File.OpenText(x)
'Read file
Do While Not CSVReader.EndOfStream() ' Loops until end of file or Stream
'Store lines in Identifier variable
Row = CSVReader.ReadLine()
'If row is not empty read line or  comment line
If Row <> "" And Mid(Row, 1, 1) <> "'" Then
'Lines count
DCount += 1
End If
'End this
Loop
'View lines count in textbox
TXTCount.Text = DCount
CSVReader.Close()
End Sub

Edited 1 Year Ago by Dani: Formatting fixed

This question has already been answered. Start a new discussion instead.