Click here to Skip to main content
15,885,125 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to capture logfile changes into a text box Pin
Marek Grzenkowicz27-Dec-06 0:47
Marek Grzenkowicz27-Dec-06 0:47 
AnswerRe: how to capture logfile changes into a text box Pin
PIEBALDconsult27-Dec-06 3:29
mvePIEBALDconsult27-Dec-06 3:29 
GeneralRe: how to capture logfile changes into a text box Pin
Luc Pattyn27-Dec-06 7:16
sitebuilderLuc Pattyn27-Dec-06 7:16 
GeneralRe: how to capture logfile changes into a text box Pin
Rafferty Uy27-Dec-06 15:47
Rafferty Uy27-Dec-06 15:47 
GeneralRe: how to capture logfile changes into a text box Pin
Luc Pattyn27-Dec-06 16:48
sitebuilderLuc Pattyn27-Dec-06 16:48 
GeneralRe: how to capture logfile changes into a text box Pin
Rafferty Uy27-Dec-06 18:50
Rafferty Uy27-Dec-06 18:50 
GeneralRe: how to capture logfile changes into a text box Pin
Luc Pattyn28-Dec-06 5:00
sitebuilderLuc Pattyn28-Dec-06 5:00 
GeneralRe: how to capture logfile changes into a text box Pin
Rafferty Uy28-Dec-06 13:47
Rafferty Uy28-Dec-06 13:47 
Hello Luc,

Thank you so much for your help. I was able to figure out what to do, the code I posted above was almost correct, I just forgot to set my processStartInfo.RedirectStandardOutput to false. Here's some fixes to the code I posted above:
<br />
using ( FileStream fileStream<br />
  = new FileStream(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) )  // setting the FileShare to ReadWrite allows the logger to keep on writing to the text file while this reads the current output.<br />
{<br />
  fileStream.Seek(_logFileLastReadPosition, SeekOrigin.Begin);<br />
<br />
  TextReader reader = new StreamReader(fileStream);<br />
<br />
  string line;<br />
  while ( (line = reader.ReadLine()) != null )<br />
  {<br />
    PerformOutputAppended(this, new OutputEventArgs(line));<br />
  }<br />
<br />
  _logFileLastReadPosition = fileStream.Seek(0, SeekOrigin.End);<br />
          <br />
  reader.Close();<br />
  fileStream.Close();<br />
}<br />


Comments/suggestions greatly appreciated. But this is already serving my needs.

Thanks again Luc!Big Grin | :-D

~Rafferty
QuestionUsing a navigator panel Pin
quiteSmart26-Dec-06 22:56
quiteSmart26-Dec-06 22:56 
QuestionMDIchild form goes behind the panel Pin
thunaivanu26-Dec-06 22:16
thunaivanu26-Dec-06 22:16 
AnswerRe: MDIchild form goes behind the panel Pin
il_masacratore27-Dec-06 2:41
il_masacratore27-Dec-06 2:41 
GeneralRe: According to your suggestions Pin
thunaivanu27-Dec-06 17:27
thunaivanu27-Dec-06 17:27 
QuestionCan any one give an idea......? Pin
ravichandratbv26-Dec-06 21:56
ravichandratbv26-Dec-06 21:56 
QuestionVoice Chat Pin
AB777126-Dec-06 21:52
AB777126-Dec-06 21:52 
QuestionHow do I call a C# DLL Using Visual Studio 2005 ( C# Code) Pin
Peter Usinga26-Dec-06 21:14
Peter Usinga26-Dec-06 21:14 
AnswerRe: How do I call a C# DLL Using Visual Studio 2005 ( C# Code) Pin
Colin Angus Mackay27-Dec-06 0:22
Colin Angus Mackay27-Dec-06 0:22 
AnswerRe: How do I call a C# DLL Using Visual Studio 2005 ( C# Code) Pin
ednrgc28-Dec-06 6:35
ednrgc28-Dec-06 6:35 
QuestionImages + Propertygrid Pin
Tanuja12326-Dec-06 19:51
Tanuja12326-Dec-06 19:51 
QuestionJPEG 2000 Pin
MozhdehQeraati26-Dec-06 19:39
MozhdehQeraati26-Dec-06 19:39 
Question???? Error in crystal Report Build by using Command SQL in c#.net ?? Pin
jaganil26-Dec-06 18:42
jaganil26-Dec-06 18:42 
GeneralRe: ???? Error in crystal Report Build by using Command SQL in c#.net ?? Pin
Tarakeshwar Reddy26-Dec-06 19:29
professionalTarakeshwar Reddy26-Dec-06 19:29 
QuestionSelection, as if it were text. [modified] Pin
Captain See Sharp26-Dec-06 15:58
Captain See Sharp26-Dec-06 15:58 
QuestionCollection.IndexOf Method Question? Pin
haz1326-Dec-06 13:46
haz1326-Dec-06 13:46 
AnswerRe: Collection.IndexOf Method Question? Pin
Christian Graus26-Dec-06 15:04
protectorChristian Graus26-Dec-06 15:04 
QuestionHow to copy and paste a file Pin
CodeItWell26-Dec-06 10:14
CodeItWell26-Dec-06 10:14 

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.