473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

c# : detect runmode

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
3 1406
#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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: R. Rajesh Jeba Anbiah | last post by:
Here is a nice code to detect utf-8 <http://in2.php.net/utf8_encode#39986> But, I couldn't find out the logic behind the script. If anyone knows that please share. Particularly I would like to...
23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
23
by: Michel Bany | last post by:
I am trying to parse responseXML from an HTTP request. var doc = request.responseXML; var elements = doc.getElementsByTagName("*"); the last statement returns an empty collection when running from...
10
by: Ben Xia | last post by:
Is there some way can detect MAC address with PHP? any help will be appreciate. Ben
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
12
by: Patrick Dugan | last post by:
I have an vb.net application that is a module that uses a "application.run" in the sub main to start. There is no form involved (just a system tray icon) How can you detect when the application...
4
by: Chris Johnson | last post by:
Hey all, I have a small app I have developed that periodically pings a list of server and returns their status. Given my environment I have setup the program such that a server can be down 4...
4
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.