using Console.Writeln(...) in WebServices or ASP.NET application

  • Thread starter Thread starter tony
  • Start date Start date
T

tony

Hello!

When you have windows forms you have the same possibility as when you have a
Console application
to use Console.Writeln to write whatever on the screen.

Now to my question:
Is it possible to use Console.Writeln when you have a Webservice. I don't
think it's possible but
just to be sure I ask you?

Is it possible to use Console.Writeln when you have a ASP.NET application
developed by using
"inline" or "Code behind" technics?

//Tony
 
Hi Tony,

Who would see the console? What would you show on the console?
You can use Console.WriteLine in any app, but the text will just vanish
unless you open a console first.
 
Hello!

Assume I use a Webrowser or a web client to call a webservice can I then
open a Console in the webservice method and write to it.
I can't just use Console.Writeln(..) in the webservice method.
You mentioned that I must open the Console first. How do I do that?
Have you some easy example how thta is being done?

//Tony
 
Hi Tony,

The console would open on the server side as the text will be written on
the server, and therefore invisible to the client. It would probably open
for the user responsible for the application pool running the web service,
but I'm not sure if it will be visible on screen if that users is logged
on to the server.

To create a new console window you can start it using the process class,
or you can route the output streams to wherever you chose.

What are you trying to do? What kind of information are you planning to
write in the console, and who should see it?


Hello!

Assume I use a Webrowser or a web client to call a webservice can I then
open a Console in the webservice method and write to it.
I can't just use Console.Writeln(..) in the webservice method.
You mentioned that I must open the Console first. How do I do that?
Have you some easy example how thta is being done?

//Tony
 
Hello!

I'm not trying to do anything but if I want to get some trace information I
thought it might be easier to write to
the Console then creating a file and then write to it.

I use localhost and IIS and I have tried to use this Consol.Writeln(..) but
no Console is created.
So you mean if I use localhost and IIS and create a console from the process
class I will be able to write to a console window.

Or do you think it's impossible to create a Console from the process class
and then write to it like a normal console application
when using localhost and IIS.


//Tony

Morten Wennevik said:
Hi Tony,

The console would open on the server side as the text will be written on
the server, and therefore invisible to the client. It would probably open
for the user responsible for the application pool running the web service,
but I'm not sure if it will be visible on screen if that users is logged
on to the server.

To create a new console window you can start it using the process class,
or you can route the output streams to wherever you chose.

What are you trying to do? What kind of information are you planning to
write in the console, and who should see it?
 
Tony,

I'm guessing the Console will be created, but noone will be able to see
it. Stick to writing to a file. In the end, data in the console will
vanish once you close it, but you can still check out the file later on.

[Create Simple Error Log Files using ASP.NET and C#]
http://www.codeproject.com/aspnet/createlogfiles.asp

There are many ways to log information



Hello!

I'm not trying to do anything but if I want to get some trace
information I
thought it might be easier to write to
the Console then creating a file and then write to it.

I use localhost and IIS and I have tried to use this Consol.Writeln(..)
but
no Console is created.
So you mean if I use localhost and IIS and create a console from the
process
class I will be able to write to a console window.

Or do you think it's impossible to create a Console from the process
class
and then write to it like a normal console application
when using localhost and IIS.


//Tony
 
Back
Top