|
-
Jul 28th, 2003, 01:32 PM
#1
Thread Starter
New Member
debug.print equivalent for C#
Does anybody have any idea on how to do VB's debug.print in C#?
-
Jul 28th, 2003, 01:39 PM
#2
Thread Starter
New Member
Nevermind I figured it out.
-
Jul 28th, 2003, 02:12 PM
#3
Frenzied Member
Please provide your answer. This way others who ask the same question can find the answer as well.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jul 28th, 2003, 02:20 PM
#4
Thread Starter
New Member
debug.print equivalent for C# (Resolved)
Sorry, inlude System.Diagnostics, then use Debug.Write to send output to the debug window, not the immediate window.
-
Jul 29th, 2003, 02:48 PM
#5
erm you dont need to use System.Diagnostics , the correct equivalent to Debug.Print in .net / C# is this :
VB Code:
Console.Write("some stuff!");
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 30th, 2003, 01:20 PM
#6
Frenzied Member
You can use Debug.Print. The out put will be in the debug window.
-
Sep 3rd, 2010, 03:00 PM
#7
New Member
Re: debug.print equivalent for C#
 Originally Posted by dynamic_sysop
erm  you dont need to use System.Diagnostics , the correct equivalent to Debug.Print in .net / C# is this :
VB Code:
Console.Write("some stuff!");
That's actually not true at all.
Debug.Print in VB prints to the Immediate Window in VS. Console.Print does not. It either prints to a console if it's a console app or to the output window.
To be technical, Debug.Print will do TraceInternal.WriteLine which will write to each TraceListener that has been loaded into Listeners.
Console.Write calls Out.Write which writes to a TextWriter object.
The correct C# equivalent of VB.Net's Debug.Print is....
Debug.Print
And for the record, Debug.Print and Debug.Write are equivalent inasmuch as where they write. Debug.Write just doesn't add the newline character. And they all print to the Immediate Window, which is the same as VB6.
-
Sep 3rd, 2010, 10:18 PM
#8
Re: debug.print equivalent for C#
There are a couple of differences between Console methods and Debug methods that haven't been mentioned. If you call Console.WriteLine then the output will be written immediately and in both Debug and Release builds. Debug.WriteLine may not write immediately and any Debug code is not compiled into a Release build. Also, both Debug and Console write to the Output window on my system, which I think is an option somewhere.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|