c# Screensaver

  • Thread starter Thread starter Simon Mercer
  • Start date Start date
S

Simon Mercer

I have been trying to build a screensaver that will connect to a database
and display specific data depending on the user that is logged in. I have
managed to get a simple data access screensaver to work, however, i can't
get the application to work with some prebuilt assemblies i have. Also,
when the screensaver is running under the windows screensaver settings it
also will not access the config file.

Any pointers would be greatly accepted

Simon
 
Well when the application is run under vs.net it works correctly as in you
can obtain keys from the ConfiurationSettings.AppSettings. When you rename
it to .scr (as well as renaming appname.scr.config) the application will not
retrieve settings from the file.

The example screensaver at the link doesn't use config files and also
compiles into a single executable, where as i have dll's i am trying to link
to.


Nicholas Paldino said:
Simon,

A screensaver is nothing more than an executable with an scr extension.
You shouldn't have any problems accessing the things you want to access.

What are the errors that you are getting, or is it just not working?

If you want, compare your code to the sample screensaver on
gotdotnet.com, located at (watch for line wrap):

http://www.gotdotnet.com/community/...mpleguid=d8ed903c-4efd-483d-92f2-c07e5d3f68ed

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Simon Mercer said:
I have been trying to build a screensaver that will connect to a database
and display specific data depending on the user that is logged in. I have
managed to get a simple data access screensaver to work, however, i can't
get the application to work with some prebuilt assemblies i have. Also,
when the screensaver is running under the windows screensaver settings it
also will not access the config file.

Any pointers would be greatly accepted

Simon
 
I haven't worked with screen saver in .NET yet, but you might want to make
sure that your config file is in the directory where Windows executes the
screen saver from, it could be that the executing path for your app is the
windows or system32 directory. Check the value of
Environment.CurrentDirectory when it's executing under windows screen saver
settings.

Just a thought...

Simon Mercer said:
Well when the application is run under vs.net it works correctly as in you
can obtain keys from the ConfiurationSettings.AppSettings. When you
rename
it to .scr (as well as renaming appname.scr.config) the application will
not
retrieve settings from the file.

The example screensaver at the link doesn't use config files and also
compiles into a single executable, where as i have dll's i am trying to
link
to.


in
message news:[email protected]...
Simon,

A screensaver is nothing more than an executable with an scr extension.
You shouldn't have any problems accessing the things you want to access.

What are the errors that you are getting, or is it just not working?

If you want, compare your code to the sample screensaver on
gotdotnet.com, located at (watch for line wrap):

http://www.gotdotnet.com/community/...mpleguid=d8ed903c-4efd-483d-92f2-c07e5d3f68ed

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Simon Mercer said:
I have been trying to build a screensaver that will connect to a
database
and display specific data depending on the user that is logged in. I have
managed to get a simple data access screensaver to work, however, i can't
get the application to work with some prebuilt assemblies i have.
Also,
when the screensaver is running under the windows screensaver settings it
also will not access the config file.

Any pointers would be greatly accepted

Simon
 
The security context in which the screensaver runs is not the interactive
users context.
Screensaver's have their own secured desktop and they run in the security
context of SYSTEM (XP) or LOCAL SERVICE (W2K3) local accounts, that means
you have to hardcode all file path's in code and make sure these accounts
are granted access rights to the DB and config file.
BTW. It's realy a bad idea to run user programs in the security context of a
screensaver.

Willy.
 
Back
Top