473,763 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send output using Console.Write.

Hi,

I'm programming a WinForm application. I would like to
enter commands that will send output that will help me to
locate bugs in the future.

I know that there is a way to send output by using the
Console.Write command. The question is how can I see the
outputs in the client machine ? Is there a specific
programm to do it or Can I use the prompt window ?

With thanks,
Boba.
Nov 13 '05 #1
2 22035

"Boba" <bo**@boba.co m> wrote in message
news:0a******** *************** *****@phx.gbl.. .
Hi,

I'm programming a WinForm application. I would like to
enter commands that will send output that will help me to
locate bugs in the future.

I know that there is a way to send output by using the
Console.Write command. The question is how can I see the
outputs in the client machine ? Is there a specific
programm to do it or Can I use the prompt window ?

With thanks,
Boba.
.


You could take a look at System.Diagnost ics.TextWriterT raceListener - it
allows you to dump text to a file. - and can have certain levels set on it.
Nov 13 '05 #2
100
Hi Boba,
If you want to see your logs on the screen during developing you can make
your project "Console Application" in project's Properties|Outp ut Type.This
will open a console window every time you start the project. In this way all
your Console.WriteLi ne logs will be visible on the screen. You have to make
your application Windows Application again when you compile the release
version, though. I haven't find a way to set "Console Application" for the
debug and "Windows Application" for the release versions of my projects.
Your Console.WriteLi ne will stay in the release code, though. So the better
idea I beliave is to use System.Diagnost ics.Debug.Write XXX methods. In this
way you can see your lines in VS.NET's Output|Debug, which is not so
comfortable, I think. The big advantage is that debug code will be in your
code only when you compile the debug versions of the project.
If you dislike (like I do) this Output window you can write and register
your own listener. But what I do actually is to set my project as a "Console
Application" and I put the folowing lines in the begining of my Main
function:
#if(DEBUG)

System.Diagnost ics.Debug.Liste ners.Add(new
System.Diagnost ics.TextWriterT raceListener(Co nsole.Out));

#endif
So, now I can see my output in the console window. All you have to do is to
make sure you return back the Application's output type to "Windows
Application" before the release compilation.

HTH
B/rgds
100

"Boba" <bo**@boba.co m> wrote in message
news:0a******** *************** *****@phx.gbl.. .
Hi,

I'm programming a WinForm application. I would like to
enter commands that will send output that will help me to
locate bugs in the future.

I know that there is a way to send output by using the
Console.Write command. The question is how can I see the
outputs in the client machine ? Is there a specific
programm to do it or Can I use the prompt window ?

With thanks,
Boba.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7781
by: Bill Cohagan | last post by:
I'm writing a console app (in C#) and I want to be able to redirect the standard input/output streams when it's run at a command prompt. IOW I want to support the "<" and ">" redirection syntax. The obvious way to do this is by using the static Console type properties, In and Out. When trying to debug the app in the IDE however, this doesn't appear to work. I've edited the project properties and added the necessary text to the "command...
4
9452
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I pass the socket to a class which just reads from the socket (in a thread). class Reader(Thread): def run(self): while 1:
6
3250
by: Tom | last post by:
I try to write a simple tcp based job queue server. It's purpose is to get commands from a client and store them in a queue (STL). The server has a thread which checks periodically the queue, executes the commands in it and removes them from the queue after done so. It also has a thread for every client connection. I am using the low level SOCKET API. My server is a Win32 console app and my client is MFC. The followinf struct is passed...
3
3707
by: Liren Zhao | last post by:
I use some "Console.WriteLine(some strings here)" to display some debug information in my winform program. How can I get the information in my programe or same them in a text file ?
0
913
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it has data send to server. 2. Client send the buffer block size. 3. Client send the actual buffer to the server. 4. Server send a flag 1 to client indicating that the buffer has been successfully receeived. 5. The next loop until all data of the...
5
1814
by: Go Perl | last post by:
Hello Here is an interesting question which I could not solve it. I have an old dos app for which source code is lost. I just have the exe file. So I have created a front-end for that. I linked the front-end to the back end exe file. Everything works fine except When I hit a button on the front end it brings up the dos app and I have to manually enter few key presses
14
11921
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was doing something was really inefficient and could reduce 10 lines of code with 2, etc. For reading, I am using a TcpClient and I call NetworkStream ns = client.GetStream(); to get a stream stream.Read(buffer, 0, buffer.Length);
4
2073
by: garyusenet | last post by:
Hi. I am trying to learn about array lists, and found an example on MSDN. I tried to compile it but it's not producing any output. I can't see why. Any ideas? Here is what I did. 1. Started new windows application. 2. Deleted the code files (program.cs, form.cs)
3
13860
by: TC | last post by:
I'm trying to debug a console application, but I can't see the console output. I've seen many references which say that console output is supposed to appear on the Output window when the application is run in Debug mode. However, I just can't get that to work. I'm using Visual Studio 2005. I've confirmed that my application is compiled as a console application, and that I'm running in Debug mode. To investigate this issue, I've reduced...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.