Windows Service

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Hi.

I'm converting a project which uses windows form UI to Windows service.
I just finished converting but I can't use any UI (winform or console).
can't Windows Service use UI?

then what will be an alternative?

help me. :-)
 
Sean said:
Hi.

I'm converting a project which uses windows form UI to Windows service.
I just finished converting but I can't use any UI (winform or console).
can't Windows Service use UI?

then what will be an alternative?

Windows NT/2K/XP/2K3 is a multi-user system. That means multiple
users are logged on at any one given time (services log in as their
own user or SYSTEM, you're logged on, FTP users, Web Users, etc).

Services run as their own user. They log in just like you do, but
they don't have a UI or desktop or windows.

Imagine a system with Terminal Services where multiple users are
logged on and there are multiple desktops.

To which desktop should the service present its UI? Console0?
What if no one is at the main console?

You can see why Services cannot present UIs.

What you should do is have a management application and expose
a remoting interface from your service. The management application
will communicate through remoting to the service to manage it.

Things you have to think about are:

- Security (what if the service has more privileges than the
user logged on. The service should only allow specific users
to access it and even then, only do specific tasks [i.e.,
don't allow them to arbitrarily write files to the disk, etc])

- Multiple users (what if two users are trying to manage your
service at the same time? Be aware of threading or
concurrency issues)

-c
 
Back
Top