Results 1 to 2 of 2

Thread: How to customise settings in a windows service...?

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    How to customise settings in a windows service...?

    I have written a windows service that does a few simple tasks.
    I would like to customise some properties for this service, that can be changed at runtime at a later date.

    What's the best way to go about this?

    I am thinking that by adding a form and a systray icon to my windows service I can popup a settings form when clicking on the systray icon.
    This form would then alloow me to customize data...but where to save? Config file? Registry?
    Any best practises on this?

    Woka

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to customise settings in a windows service...?

    I assume that you have the systray and form running under a different context (user) interacting with the service so I would say a config file definately but it should be stored in the appdata folder if the settings are user specific. If not then of course a public location. Avoid the registry IMO.

    Woof!
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width