Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 569567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:18:32+00:00 2026-05-13T13:18:32+00:00

As a practice exercise at my college we have to make a simple room

  • 0

As a practice exercise at my college we have to make a simple room booking system, complete with its own config file. We’re not allowed to use the one built into VB.NET (the professor wants us to adapt to not relying on things like that) so I’ve made my own. This is a sample:

// Config file.
// First column is the variable name that will be used to
// reference the value in the second column. Seperate each
// setting with a new line.

MasterUser  Chris

DatabasePath    C:\Users\Chris\Desktop\Project.mdb

Comments in the file are pretty self-explanatory. I can parse the file fine, but what I’m having trouble with is making a variable the same name as whats in the first column. For example I need to make a variable called MasterUser and one called DatabasePath that holds Chris and C:\Users\Chris\Desktop\Project.mdb as values respectively. But I have no idea how to make a variable called that.

Any help would be cool, thanks. 🙂

EDIT: You can’t see it from the code view here, but the variable name and value in the config file are separated by a tab 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:18:33+00:00Added an answer on May 13, 2026 at 1:18 pm

    You might want to consider using a better format for your configuration file, like XML. This will give you a lot more library support for parsing and searching within the file… that said, in this simple case, it looks like you just need a simple Dictionary(Of String, String) which probably won’t make a lot of sense if you haven’t learned about Generics yet 🙂

    Basically you can load values in like this:

    Dim settings As New Dictionary(Of String, String)
    settings.Add("MasterUser", "Chris")
    settings.Add("DatabasePath", "C:\Users\Chris\Desktop\Project.mdb")
    

    Then when you want to retrieve a value based on the key in the dictionary, you can do it like this:

    Dim master As String = settings("MasterUser") ' master = "Chris"
    

    I hope that helps clear things up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it bad practice to have a custom cursor on a website? Not just
As a practice exercise, I am creating my own generic class that is basically
I have been working on creating a custom allocator as a fun exercise/practice and
I'm trying to create my own templated List class as a practice excercise. I
It's common practice for tables of regression outcomes in academic papers to have a
Is it a good practice to have multiple XXX : DbContext classes for each
I'm making a simple tic tac toe game as an exercise in LWJGL. When
I am pretty new to C# and as a practice exercise was trying to
I am studying the SCJP, and while studying I have found an exercise that
I implemented a new system call as an intro exercise. All it does is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.