Click here to Skip to main content
15,892,298 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: please help Pin
pmarfleet17-Oct-07 6:43
pmarfleet17-Oct-07 6:43 
AnswerRe: please help Pin
Christian Graus17-Oct-07 9:47
protectorChristian Graus17-Oct-07 9:47 
AnswerRe: please help Pin
Pete O'Hanlon17-Oct-07 10:04
mvePete O'Hanlon17-Oct-07 10:04 
QuestionConvert binary string to integer Pin
VFaul17-Oct-07 4:21
VFaul17-Oct-07 4:21 
AnswerRe: Convert binary string to integer Pin
Ky Nam17-Oct-07 5:08
Ky Nam17-Oct-07 5:08 
QuestionRowcount a text file and if the value is less then one, delete the file Pin
Support12317-Oct-07 3:48
Support12317-Oct-07 3:48 
QuestionRe: Rowcount a text file and if the value is less then one, delete the file Pin
Support12317-Oct-07 3:51
Support12317-Oct-07 3:51 
AnswerRe: Rowcount a text file and if the value is less then one, delete the file Pin
Dave Kreskowiak17-Oct-07 12:30
mveDave Kreskowiak17-Oct-07 12:30 
Batch file?? You could probably hack somethline together, though this is too easy to write yourself. Just use a FileStream and a vairable to increment. Read the file line by line and increment a counter for each line.
Imports System.Io
.
.
.
Public Shared Function CountLinesInFile(ByVal filepath As String) As Integer
    If File.Exists(filepath) Then
        Using fs As New StreamReader(filepath)
            Dim count As Integer = 0
            While Not fs.EndOfStream
                fs.ReadLine()
                count += 1
            End While
            Return count
        End Using
    End If
    Throw New FileNotFoundException(filepath)
End Function



A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Rowcount a text file and if the value is less then one, delete the file Pin
Support12317-Oct-07 19:22
Support12317-Oct-07 19:22 
GeneralRe: Rowcount a text file and if the value is less then one, delete the file Pin
Support12317-Oct-07 21:06
Support12317-Oct-07 21:06 
Questioninternet cafe timer.. Pin
Bluei217-Oct-07 3:25
Bluei217-Oct-07 3:25 
AnswerRe: internet cafe timer.. Pin
Christian Graus17-Oct-07 9:50
protectorChristian Graus17-Oct-07 9:50 
AnswerRe: internet cafe timer.. Pin
svanwass18-Oct-07 9:12
svanwass18-Oct-07 9:12 
QuestionThe designer cannot create an instance of type declared as abstract. Pin
Ky Nam17-Oct-07 3:22
Ky Nam17-Oct-07 3:22 
AnswerRe: The designer cannot create an instance of type declared as abstract. Pin
Dave Kreskowiak17-Oct-07 9:15
mveDave Kreskowiak17-Oct-07 9:15 
AnswerRe: The designer cannot create an instance of type declared as abstract. Pin
nlarson1117-Oct-07 10:32
nlarson1117-Oct-07 10:32 
QuestionQuestion about office files.... Pin
ninkk17-Oct-07 3:12
ninkk17-Oct-07 3:12 
AnswerRe: Question about office files.... Pin
ninkk17-Oct-07 9:55
ninkk17-Oct-07 9:55 
AnswerRe: Question about office files.... Pin
Dave Kreskowiak17-Oct-07 12:17
mveDave Kreskowiak17-Oct-07 12:17 
GeneralRe: Question about office files.... Pin
ninkk17-Oct-07 21:52
ninkk17-Oct-07 21:52 
GeneralRe: Question about office files.... Pin
Dave Kreskowiak18-Oct-07 1:41
mveDave Kreskowiak18-Oct-07 1:41 
Questionplease help Pin
Sonia Gupta17-Oct-07 3:09
Sonia Gupta17-Oct-07 3:09 
AnswerRe: please help Pin
kubben17-Oct-07 3:11
kubben17-Oct-07 3:11 
GeneralRe: please help Pin
Sonia Gupta17-Oct-07 3:19
Sonia Gupta17-Oct-07 3:19 
GeneralRe: please help Pin
kubben17-Oct-07 3:21
kubben17-Oct-07 3:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.