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

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
 
M

Morten Wennevik

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.
 
T

tony

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
 
M

Morten Wennevik

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
 
T

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?
 
M

Morten Wennevik

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
 

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top