Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 2nd, 2005, 06:12 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Windows C# application that survives logoffs

How do I create a C# Windows application that survives logoffs (windows xp/nt) and that if opened in some user and the user logs off and another user logs in - the same instance of the application will be alive all this time.

Meaning that while the windows is opened and the application is opened, it will not be closed by an indirect action.

Any help would be appreciated.
 
Old October 2nd, 2005, 07:11 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This sounds like a good job for a Windows Service that you can create with Visual Studio .NET relatively easy.

Search this: http://www.google.com/search?hl=en&q...ervice%22+.NET for articles about creating windows services.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 9th, 2005, 05:11 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately, I cannot use this application as a Windows Service.
However, I tried making it a scheduled task but when I uncheck "Run only if logged on" and set a valid password, it gives me an error: 0X80070005 Access is denied. You do not have persmission to perform the requested operation.

How can I run this as a scheduled task?
 
Old October 9th, 2005, 05:13 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately, I cannot use this application as a Windows Service.
However, I tried making it a scheduled task but when I uncheck "Run only if logged on" and set a valid password, it gives me an error: 0X80070005 Access is denied. You do not have permission to perform the requested operation.

How can I run this as a scheduled task?
 
Old October 9th, 2005, 01:01 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

When do you get this error?

is your application trying to access network resources?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 11th, 2005, 06:57 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I set a scheduled task (in windows control panel) to execute the exe file of my application. And I try to set in the properties uncheck to "Run only if logged on", and then when I click on "apply" it gives me the mentioned error, meaning, before I can even run it.

 
Old October 11th, 2005, 02:39 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Marla,

Could this be a permissions issue? What account are you using? Maybe, although I am not sure, the account you schedule the task for needs permissions like "logon as a batch job"....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 16th, 2005, 02:55 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,
No, the account is administrator.
Thanks anyways.. I'm kinda lost here :)

Quote:
quote:Originally posted by Imar
 Hi Marla,

Could this be a permissions issue? What account are you using? Maybe, although I am not sure, the account you schedule the task for needs permissions like "logon as a batch job"....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with windows application and DLL naikpalak722 General .NET 0 October 2nd, 2007 03:08 PM
Web Application OR Windows Application adesilva .NET Framework 2.0 2 May 4th, 2007 07:12 AM
Windows Form Application help tycotrix C# 4 January 11th, 2007 07:15 AM
Multithreading in c# windows application dhol General .NET 2 September 10th, 2005 02:04 AM
Web application Vs Windows Application Ned .NET Web Services 2 January 20th, 2004 01:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.