Click here to Skip to main content
15,911,789 members
Home / Discussions / C#
   

C#

 
GeneralRe: thoughts on localizing SQL exceptions? Pin
Wendelius18-Nov-08 10:34
mentorWendelius18-Nov-08 10:34 
QuestionSpecifying pointer address, or something like that... Pin
boberick218-Nov-08 8:08
boberick218-Nov-08 8:08 
AnswerRe: Specifying pointer address, or something like that... Pin
Dave Kreskowiak18-Nov-08 8:21
mveDave Kreskowiak18-Nov-08 8:21 
GeneralRe: Specifying pointer address, or something like that... Pin
boberick218-Nov-08 8:37
boberick218-Nov-08 8:37 
GeneralRe: Specifying pointer address, or something like that... Pin
Paul Conrad18-Nov-08 8:43
professionalPaul Conrad18-Nov-08 8:43 
QuestionWeakreference Pin
Seetha.R18-Nov-08 6:41
Seetha.R18-Nov-08 6:41 
AnswerRe: Weakreference [modified] Pin
Lutosław18-Nov-08 6:53
Lutosław18-Nov-08 6:53 
AnswerRe: Weakreference Pin
Guffa18-Nov-08 11:55
Guffa18-Nov-08 11:55 
GeneralRe: Weakreference Pin
Seetha.R18-Nov-08 22:42
Seetha.R18-Nov-08 22:42 
QuestionHow to learn computer name? Pin
Sokka9318-Nov-08 5:46
Sokka9318-Nov-08 5:46 
AnswerRe: How to learn computer name? Pin
Giorgi Dalakishvili18-Nov-08 6:07
mentorGiorgi Dalakishvili18-Nov-08 6:07 
AnswerRe: How to learn computer name? Pin
Sokka9318-Nov-08 6:40
Sokka9318-Nov-08 6:40 
Questionweb service Pin
netJP12L18-Nov-08 5:16
netJP12L18-Nov-08 5:16 
AnswerRe: web service Pin
Ennis Ray Lynch, Jr.18-Nov-08 5:28
Ennis Ray Lynch, Jr.18-Nov-08 5:28 
AnswerRe: web service Pin
Wendelius18-Nov-08 5:39
mentorWendelius18-Nov-08 5:39 
GeneralRe: web service Pin
netJP12L18-Nov-08 6:04
netJP12L18-Nov-08 6:04 
GeneralRe: web service [modified] Pin
Wendelius18-Nov-08 6:24
mentorWendelius18-Nov-08 6:24 
GeneralRe: web service Pin
netJP12L18-Nov-08 7:26
netJP12L18-Nov-08 7:26 
Questionbinary trees and traverse Pin
nesfrank18-Nov-08 5:06
nesfrank18-Nov-08 5:06 
AnswerRe: binary trees and traverse Pin
Pedram Behroozi18-Nov-08 5:59
Pedram Behroozi18-Nov-08 5:59 
AnswerRe: binary trees and traverse Pin
Alan Balkany19-Nov-08 3:53
Alan Balkany19-Nov-08 3:53 
GeneralRe: binary trees and traverse Pin
nesfrank19-Nov-08 8:12
nesfrank19-Nov-08 8:12 
GeneralRe: binary trees and traverse Pin
Alan Balkany19-Nov-08 8:17
Alan Balkany19-Nov-08 8:17 
QuestionDebug Statements - writing to the console and files Pin
stormydaniels18-Nov-08 4:18
stormydaniels18-Nov-08 4:18 
Hi,

I'm writing an application in which I'm currently using Console.Writeline() calls to output the various stages. This helps me to develop and debug as I go. However, the time will come when I want to remove all such calls. Can anyone suggest some advice, an article (I have searched on CP) or other source which will tell me how to use debug statements in code which I can then switch off for release.

I was thinking of a logging class - in debug mode it would write to the console but in release mode it would write certain information to a file. The Console.Writeline() methods allows me to do the following:

Console.Writeline("Val1 {0}, Val2 {2}", val1, val2);

How could I write my own function which would accept an unknown number of parameters like this? I would like my function to pass the parameters directly to Console.Writeline() or to a file depending on a flag.

Thanks for any help offered Smile | :)
AnswerRe: Debug Statements - writing to the console and files Pin
DaveyM6918-Nov-08 4:27
professionalDaveyM6918-Nov-08 4:27 

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.