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

Visual Basic

 
QuestionRead last line of logfile and close file immediately Pin
bodobe19-Feb-07 10:10
bodobe19-Feb-07 10:10 
AnswerRe: Read last line of logfile and close file immediately Pin
Marcus J. Smith19-Feb-07 10:14
professionalMarcus J. Smith19-Feb-07 10:14 
GeneralRe: Read last line of logfile and close file immediately Pin
bodobe19-Feb-07 10:23
bodobe19-Feb-07 10:23 
GeneralRe: Read last line of logfile and close file immediately Pin
Marcus J. Smith19-Feb-07 10:29
professionalMarcus J. Smith19-Feb-07 10:29 
GeneralRe: Read last line of logfile and close file immediately Pin
bodobe19-Feb-07 10:40
bodobe19-Feb-07 10:40 
GeneralRe: Read last line of logfile and close file immediately Pin
Marcus J. Smith19-Feb-07 10:47
professionalMarcus J. Smith19-Feb-07 10:47 
AnswerRe: Read last line of logfile and close file immediately Pin
TwoFaced19-Feb-07 13:06
TwoFaced19-Feb-07 13:06 
GeneralRe: Read last line of logfile and close file immediately Pin
bodobe20-Feb-07 20:43
bodobe20-Feb-07 20:43 
Hi, thanks a lot, works great! I only had to place the IO.File.Open(...) into a Try..Catch, because the FileSystemWatche raises the FileChanged-Event a bit too early: File has been changed, but not yet been closed by the other software.

While LogReadPermission <> True
Try
stream = IO.File.Open(LogFile, FileMode.Open, FileAccess.Read)
LogReadPermission = True 'if stream has been opened without exception, allow reading and leave 'while'
Catch ex As Exception
Threading.Thread.Sleep(5) 'short wait before next try
i += 1
If i > 100 Then
MsgBox("Logfile not found! " & ex.ToString)
End If
End Try

End While
stream.Position = Index
stream.Read(buf, 0, count)
...
GeneralRe: Read last line of logfile and close file immediately Pin
TwoFaced20-Feb-07 21:32
TwoFaced20-Feb-07 21:32 
GeneralRe: Read last line of logfile and close file immediately Pin
Marcus J. Smith23-Feb-07 5:20
professionalMarcus J. Smith23-Feb-07 5:20 
QuestionVB6.0 - Common Dialog "ShowSave" method to get a Folder? Pin
ChemmieBro19-Feb-07 9:55
ChemmieBro19-Feb-07 9:55 
QuestionEncrypted source files Pin
Fernando A. Gomez F.19-Feb-07 8:38
Fernando A. Gomez F.19-Feb-07 8:38 
AnswerRe: Encrypted source files Pin
Dave Kreskowiak19-Feb-07 9:33
mveDave Kreskowiak19-Feb-07 9:33 
GeneralRe: Encrypted source files Pin
Fernando A. Gomez F.19-Feb-07 10:43
Fernando A. Gomez F.19-Feb-07 10:43 
QuestionUseing Serial Port Pin
Max Bayne19-Feb-07 8:13
Max Bayne19-Feb-07 8:13 
AnswerRe: Useing Serial Port Pin
Ankur.Bakliwal19-Feb-07 17:35
Ankur.Bakliwal19-Feb-07 17:35 
Questiondisable groupbox Pin
jds120719-Feb-07 7:56
jds120719-Feb-07 7:56 
AnswerRe: disable groupbox Pin
Marcus J. Smith19-Feb-07 8:19
professionalMarcus J. Smith19-Feb-07 8:19 
AnswerRe: disable groupbox Pin
TwoFaced19-Feb-07 8:23
TwoFaced19-Feb-07 8:23 
QuestionCONVERSION OF VB CODE TO JAVASCRIPT Pin
soadfreak19-Feb-07 7:48
soadfreak19-Feb-07 7:48 
AnswerRe: CONVERSION OF VB CODE TO JAVASCRIPT Pin
Christian Graus19-Feb-07 8:53
protectorChristian Graus19-Feb-07 8:53 
Questionadding new record and saving in VB.NET Pin
7prince19-Feb-07 6:15
7prince19-Feb-07 6:15 
AnswerRe: adding new record and saving in VB.NET Pin
Marcus J. Smith19-Feb-07 8:24
professionalMarcus J. Smith19-Feb-07 8:24 
GeneralRe: adding new record and saving in VB.NET Pin
7prince19-Feb-07 8:46
7prince19-Feb-07 8:46 
AnswerRe: adding new record and saving in VB.NET Pin
Christian Graus19-Feb-07 10:17
protectorChristian Graus19-Feb-07 10:17 

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.