Passing parameters best practice

Discussion in 'ASP .Net' started by tshad, Aug 9, 2006.

  1. tshad

    tshad Guest

    I need to pass a few parameters to my Windows Service program. The end user
    will be changing the parameters and settings should be saved.

    What is the best practice
    - use app.config
    - use .ini file
    - use Registry
    - write a Windows Application program and save the settings to database
    table

    should I trust the end user to modify registry, .config or .ini file?

    Thanks,

    Tom
     
    tshad, Aug 9, 2006
    #1
    1. Advertising

  2. I think no matter what mechanism you use, you should have a front end
    interface for the user to use. The user shouldn't have to dig into the
    registry, or the config file of the application.

    These various places have various degrees of security. If your parameters
    don't need to be secure, then you could go either the registry route, or
    app.config.

    No matter what route you take, you will need to restart your windows service
    to pick up the new configuration settings.

    "tshad" <> wrote in message
    news:uM$sn%...
    >I need to pass a few parameters to my Windows Service program. The end user
    >will be changing the parameters and settings should be saved.
    >
    > What is the best practice
    > - use app.config
    > - use .ini file
    > - use Registry
    > - write a Windows Application program and save the settings to database
    > table
    >
    > should I trust the end user to modify registry, .config or .ini file?
    >
    > Thanks,
    >
    > Tom
    >
     
    Marina Levit [MVP], Aug 9, 2006
    #2
    1. Advertising

  3. tshad

    sloan Guest

    My preferred route these days is a custom configuration section/handler.

    http://support.microsoft.com/kb/309045/EN-US/

    After you do 1 or 2 of them (aka, get past the struggle part), they are
    simple to write.

    It gives you a true "object" at the end of the day to encapsulate your
    values...instead of always getting the app/key/value.
    It keeps the app.config file organized and neat also.




    "tshad" <> wrote in message
    news:uM$sn%...
    > I need to pass a few parameters to my Windows Service program. The end

    user
    > will be changing the parameters and settings should be saved.
    >
    > What is the best practice
    > - use app.config
    > - use .ini file
    > - use Registry
    > - write a Windows Application program and save the settings to database
    > table
    >
    > should I trust the end user to modify registry, .config or .ini file?
    >
    > Thanks,
    >
    > Tom
    >
    >
     
    sloan, Aug 9, 2006
    #3
  4. tshad

    sloan Guest

    Please do not cross post.

    http://groups.google.com/group/micr...0ec80b5458e?lnk=st&q=&rnum=1#fef8e0ec80b5458e

    http://groups.google.com/group/micr...0d3559e2828/bddc6e384504155e#bddc6e384504155e

    microsoft.public.dotnet.languages.csharp
    microsoft.public.dotnet.languages.vb


    "tshad" <> wrote in message
    news:uM$sn%...
    > I need to pass a few parameters to my Windows Service program. The end

    user
    > will be changing the parameters and settings should be saved.
    >
    > What is the best practice
    > - use app.config
    > - use .ini file
    > - use Registry
    > - write a Windows Application program and save the settings to database
    > table
    >
    > should I trust the end user to modify registry, .config or .ini file?
    >
    > Thanks,
    >
    > Tom
    >
    >
     
    sloan, Aug 9, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. * Tong *
    Replies:
    2
    Views:
    2,640
    Joe Smith
    Sep 28, 2006
  2. Replies:
    1
    Views:
    350
    Martin Eisenberg
    Nov 11, 2008
  3. Ramon F Herrera
    Replies:
    8
    Views:
    491
    Pascal J. Bourguignon
    Sep 13, 2009
  4. Mario T. Lanza
    Replies:
    0
    Views:
    123
    Mario T. Lanza
    Feb 16, 2004
  5. oldyork90
    Replies:
    1
    Views:
    168
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page