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

Visual Basic

 
GeneralRe: NI Measurement Studio question Pin
Dave Kreskowiak6-Feb-09 22:45
mveDave Kreskowiak6-Feb-09 22:45 
GeneralRe: NI Measurement Studio question Pin
Nick Alexeev7-Feb-09 10:28
professionalNick Alexeev7-Feb-09 10:28 
QuestionStreamwriter and thread safety Pin
NeilPrice6-Feb-09 9:50
NeilPrice6-Feb-09 9:50 
AnswerRe: Streamwriter and thread safety Pin
Christian Graus6-Feb-09 10:27
protectorChristian Graus6-Feb-09 10:27 
GeneralRe: Streamwriter and thread safety Pin
NeilPrice6-Feb-09 10:35
NeilPrice6-Feb-09 10:35 
GeneralRe: Streamwriter and thread safety Pin
Dave Kreskowiak6-Feb-09 11:12
mveDave Kreskowiak6-Feb-09 11:12 
GeneralRe: Streamwriter and thread safety Pin
NeilPrice6-Feb-09 11:28
NeilPrice6-Feb-09 11:28 
GeneralRe: Streamwriter and thread safety Pin
Luc Pattyn6-Feb-09 11:41
sitebuilderLuc Pattyn6-Feb-09 11:41 
Hi,

IMO logging should be inexpensive and as real-time as possible, hence buffering, locking, thread switching are to be avoided. I tend to open-append-close for each individual log message, since the last message before the app dies is probably the one you want to catch most of all.

The good news is File.AppendAllText() is a static and thread-safe method that does exactly that:
open-append-close without unnecessary hassle. It does perform security checks over and over, so
you'd better log to a local file without special security issues.

BTW: if you want to add an option to e-mail your log file from within the app, you really need
to copy it first, otherwise mailing it and continuing to log would interfere...

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


QuestionTextbox prblem Pin
-kikica0512-6-Feb-09 9:09
-kikica0512-6-Feb-09 9:09 
GeneralRe: Textbox prblem Pin
Luc Pattyn6-Feb-09 9:26
sitebuilderLuc Pattyn6-Feb-09 9:26 
GeneralRe: Textbox prblem Pin
-kikica0512-6-Feb-09 19:29
-kikica0512-6-Feb-09 19:29 
GeneralRe: Textbox prblemsta Pin
Luc Pattyn7-Feb-09 3:16
sitebuilderLuc Pattyn7-Feb-09 3:16 
AnswerRe: Textbox prblem [modified] Pin
Samir Ibrahim7-Feb-09 7:28
Samir Ibrahim7-Feb-09 7:28 
Question[Message Deleted] Pin
spruha3696-Feb-09 3:08
spruha3696-Feb-09 3:08 
AnswerRe: searching all types of files in all drives Pin
Dave Kreskowiak6-Feb-09 3:45
mveDave Kreskowiak6-Feb-09 3:45 
AnswerRe: searching all types of files in all drives Pin
Christian Graus6-Feb-09 10:25
protectorChristian Graus6-Feb-09 10:25 
General[Message Deleted] Pin
spruha3696-Feb-09 15:06
spruha3696-Feb-09 15:06 
GeneralRe: searching all types of files in all drives Pin
Dave Kreskowiak6-Feb-09 18:59
mveDave Kreskowiak6-Feb-09 18:59 
GeneralRe: searching all types of files in all drives Pin
Samir Ibrahim7-Feb-09 6:50
Samir Ibrahim7-Feb-09 6:50 
GeneralRe: searching all types of files in all drives Pin
Dave Kreskowiak7-Feb-09 9:02
mveDave Kreskowiak7-Feb-09 9:02 
General[Message Deleted] Pin
spruha3698-Feb-09 19:00
spruha3698-Feb-09 19:00 
GeneralRe: searching all types of files in all drives Pin
Mycroft Holmes8-Feb-09 21:31
professionalMycroft Holmes8-Feb-09 21:31 
GeneralRe: searching all types of files in all drives Pin
Dave Kreskowiak9-Feb-09 1:48
mveDave Kreskowiak9-Feb-09 1:48 
Questioncode to import calendars from application such as outlook,hotmail, Gmail Pin
naria20066-Feb-09 2:58
naria20066-Feb-09 2:58 
AnswerRe: code to import calendars from application such as outlook,hotmail, Gmail Pin
Steven J Jowett6-Feb-09 3:00
Steven J Jowett6-Feb-09 3:00 

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.