467,886 Members | 1,786 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,886 developers. It's quick & easy.

Instead of Control Panel Applet

My C# application is a Windows Service. I have two problems that I
would like to solve in the correct way using C#.NET.

1) There are a number of user settings which I'd like to store in an
XML file. I read these settings each time the service does some work,
then close the file. Should I use the Configuration class to read
this file from my service code?

2) I'd like to give the users a control panel application to change
the settings in a GUI. Well, not an old unmanaged .cpl, but whatever
we're "supposed to" be using now in .NET applications. Is there some
new psuedo-cpl hosting container in .NET that takes the place of what
Control Panel did? If not, how are people providing GUIs for their
users to change service settings?

TIA, Grok
Dec 16 '07 #1
  • viewed: 1937
Share:
3 Replies
Grok,

1) Yes, you should. You should create a custom configuration section
handler if you have some complex data structures that you need to store,
otherwise, you can just add the values you need to the config file for the
executable.

2) There isn't a way to do this from .NET. You can not export functions
from a DLL in .NET, which is what a control panel applet needs. You could
create an unmanaged DLL in an unmanaged language, and then call into a .NET
assembly though.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Grok" <gr**@valhallalegends.comwrote in message
news:0l********************************@4ax.com...
My C# application is a Windows Service. I have two problems that I
would like to solve in the correct way using C#.NET.

1) There are a number of user settings which I'd like to store in an
XML file. I read these settings each time the service does some work,
then close the file. Should I use the Configuration class to read
this file from my service code?

2) I'd like to give the users a control panel application to change
the settings in a GUI. Well, not an old unmanaged .cpl, but whatever
we're "supposed to" be using now in .NET applications. Is there some
new psuedo-cpl hosting container in .NET that takes the place of what
Control Panel did? If not, how are people providing GUIs for their
users to change service settings?

TIA, Grok
Dec 16 '07 #2
On Sun, 16 Dec 2007 15:26:17 -0500, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comwrote:
>Grok,

2) There isn't a way to do this from .NET. You can not export functions
from a DLL in .NET, which is what a control panel applet needs. You could
create an unmanaged DLL in an unmanaged language, and then call into a .NET
assembly though.
(I accept that control panel is 'out', and only brought it up as an
example)

Given that, what are people doing in .NET to create user GUI to change
settings for a service? Surely, writing a service and then providing
GUI access to its configurable values is not uncommon.

I'm hesitant to write a simple windows app that will show up on their
start menu as more clutter. Is there another container? Just want to
do the right thing and conform to how the community is doing it.
Dec 16 '07 #3
Grok,

Well, you could create a Microsoft Management Console snap in and then
modify the settings from there. Changing the settings for the config file
doesn't warrant an MMC plug in, IMO, as those plug-ins are meant to really
show more real-time information. If you want to do that, then you will have
to create a remoting endpoing of some kind in your service (using remoting,
WCF, or some other technology/protocol) and then communicate with it from
your plug-in/stand alone program.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Grok" <gr**@valhallalegends.comwrote in message
news:3u********************************@4ax.com...
On Sun, 16 Dec 2007 15:26:17 -0500, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comwrote:
>>Grok,

2) There isn't a way to do this from .NET. You can not export functions
from a DLL in .NET, which is what a control panel applet needs. You could
create an unmanaged DLL in an unmanaged language, and then call into a
.NET
assembly though.

(I accept that control panel is 'out', and only brought it up as an
example)

Given that, what are people doing in .NET to create user GUI to change
settings for a service? Surely, writing a service and then providing
GUI access to its configurable values is not uncommon.

I'm hesitant to write a simple windows app that will show up on their
start menu as more clutter. Is there another container? Just want to
do the right thing and conform to how the community is doing it.
Dec 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Vincent Montressor | last post: by
1 post views Thread by Stuart Roberts | last post: by
reply views Thread by rajani | last post: by
7 posts views Thread by Jay | last post: by
reply views Thread by Steve in Albury | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.