By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,969 Members | 2,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,969 IT Pros & Developers. It's quick & easy.

c# : detect runmode

P: n/a
hello,
i m looking for detect the runmode (console, aspx, etc) and adapt my class
(delegate) for output writting...

thx

mcf

Mar 30 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
#if DEBUG
....
#else
#endif

Note that DEBUG conditional is used by default in Debug configuration.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Steph" <pi**@pipo.com> wrote in message
news:44***********************@news.wanadoo.fr...
hello,
i m looking for detect the runmode (console, aspx, etc) and adapt my class
(delegate) for output writting...

thx

mcf

Mar 30 '06 #2

P: n/a

"Steph" <pi**@pipo.com> wrote in message
news:44***********************@news.wanadoo.fr...
hello,
i m looking for detect the runmode (console, aspx, etc) and adapt my class
(delegate) for output writting...


Use a static method that calls a delegate set up by the main process (or ASP
equivalent) or from a config file on first call.

The Debug/Trace listeners would be your model.
Mar 30 '06 #3

P: n/a
Hi,

You can declare an interface like
public interface Logger{
void WriteLog( string msg, ..... );
}

you can implement classes as needed to cover each escenario and you just
pass an instance of it to your current class.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Steph" <pi**@pipo.com> wrote in message
news:44***********************@news.wanadoo.fr...
hello,
i m looking for detect the runmode (console, aspx, etc) and adapt my class
(delegate) for output writting...

thx

mcf

Mar 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.