Results 1 to 9 of 9

Thread: Get Application Settings

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    21

    Get Application Settings

    I coded a Visual Basic application with a password stored in in the Application Settings.

    Is it possible to read these settings outside the application, from the registry, from a .ini file or something?? Where is these settings stored?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Get Application Settings

    they are stored in a file... a text file.... in the same folder as your app. Design time it's called application.config..... at runtime, or rather after compiling, it's called {your app's exe name].exe.config.

    And it's a plain jane xml file for all the world to read.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Get Application Settings

    It is possible to encrypt all or part of a config file if it contains sensitive information. The .NET configuration classes handle the job of decrypting when reading and encrypting when writing without you lifting a finger. You just have to perform the initial encryption of the file. MSDN has the details.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    21

    Re: Get Application Settings

    All I found that was similar to my Application Settings was;

    <userSettings>
    <IMEICheckerSalg.My.MySettings>
    <setting name="ConnectionString" serializeAs="String">
    <value />
    </setting>
    </IMEICheckerSalg.My.MySettings>
    </userSettings>

    I have a Settings variable called ConnectionString, but it seems it's blank. Also I have 3-4 other variables stored in the application settings, but I can't find them.

    My VB application reads out the settings from somewhere, but WHERE?

  5. #5
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: Get Application Settings

    Hi,

    I am Using Visual Basic 2005 Express Edition

    Try to search at:
    C:\Documents and Settings\Owner\Local Settings\Application Data\*.*
    It must be there under your "Your Company Name".

    I don't understand how to:
    It is possible to encrypt all or part of a config file if it contains sensitive information. The .NET configuration classes handle the job of decrypting when reading and encrypting when writing without you lifting a finger. You just have to perform the initial encryption of the file. MSDN has the details.
    Can someone explain it to me?

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Get Application Settings

    Quote Originally Posted by yulyos
    Hi,

    I am Using Visual Basic 2005 Express Edition

    Try to search at:
    C:\Documents and Settings\Owner\Local Settings\Application Data\*.*
    It must be there under your "Your Company Name".

    I don't understand how to:


    Can someone explain it to me?
    http://search.msdn.microsoft.com/sea...t+config+files

    On the US MSDN site that search will return what you need in the first two matches. It says for ASP.NET but the same principles can be applied to WinForms applications.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: Get Application Settings

    Hi,

    I looked at the link:
    http://search.msdn.microsoft.com/sea...t+config+files

    and I don’t understand nothing.

    My question is:
    How can my program Encrypt and Decrypt and save my user.config settings file?

    Thanks in advance

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Get Application Settings

    http://msdn2.microsoft.com/en-us/library/ms998283.aspx

    From Step 3:
    use the–pef switch, which allows you to specify the physical directory location of your configuration file.

    aspnet_regiis.exe -pef "connectionStrings" C:\Projects\MachineRSA
    So, you can use that commandline to encrypt a section named "connectionString" in a config file contained in a folder named "C:\Projects\MachineRSA".

    The section on Web Farms is analogous to a deployed WinForms application.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: Get Application Settings

    Hi,

    Thanks for your help, but I give up.

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