Look up Log4Net. It can log debug messages to almost anything, you can
change the config file for the level of logging you want while your
application is running, and its free. (http://logging.apache.org/log4net/)
If you really want to open a Console, there are Win32 functions to open them
and what not. Look up AllocConsole, and FreeConsole in MSDN.
An even easier way is to use the www.sysinternals.com tool DebugView with
debugger messages. This also works as a source for Log4Net (see above). The
problem with this is that debug logging only occurs for debug builds. So no
logging in production environment.
cmd.exe is the MS-DOS command line, it's not the debug console you want.
You have a couple of options, IMO the easier/more convenient one is using
the event log.
Of course you can do a similar thing, just that you cannot use the cmd.exe
program.
Do as I said, create a new form with a textbox, add a method like
WriteLog( ) that write in the textbox.
Intercept the KeyPress event of the control to allow only the cursor to be
used, all others will be "handled" by your method.
very easy indeed.
cheers,
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.