PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms (2.0) running an app in either Interactive or Non-Interactive mode

Reply

(2.0) running an app in either Interactive or Non-Interactive mode

 
Thread Tools Rate Thread
Old 09-02-2006, 07:19 PM   #1
Tim_Mac
Guest
 
Posts: n/a
Default (2.0) running an app in either Interactive or Non-Interactive mode


hi,
i have a win-forms app that has a few forms in it. They obviously
appear on screen when the app is launched. however, i want the program
to run as a scheduled task when there is no user logged on.
i checked out Environment.UserInteractive and it gives me what i need
to know, but how should i launch the app? i currently use
Application.Run(new MainForm())

i can obviously separate out the logic from the user-interface, and do
something like:

if(Environment.UserInteractive)
Application.Run(new MainForm())
else
{
Application.Run();
new ScheduledTask().Start();
// etc etc
}

i'm just wondering if somebody else has any better suggestions?
thanks
tim

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off