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 3458536
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:59:41+00:00 2026-05-18T09:59:41+00:00

I currently have a winform with a listbox control that allows a user to

  • 0

I currently have a winform with a listbox control that allows a user to browse directories and add them to the listbox. These directory locations will then be saved using the application settings file (as a string?), but I’m not sure how I should separate each directory string. Upon reloading of the form, I would like all the directories to be loading into the listbox as individual items from the settings file.

So I technically have two questions:

  1. What would be the most efficient way to save multiple locations within the application settings file?

  2. How would I go about loading the directories into the listbox from the settings? (Remember, there’s multiple directories)

My idea was to store all the directories in one string setting and separate them with a comma, but I’m not sure if there’s a more efficient method to do this.

  • 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-18T09:59:41+00:00Added an answer on May 18, 2026 at 9:59 am

    NO!!!! NEVER DO THAT!!!!
    Comma can be included in folder name and if you use comma as separator it could bring many critical issues to your program.

    you can use characters that are illegal in folder names in windows.
    \ / : * ? " < > |

    also you can not use \ and / because path maybe stores as c:\\data\\ and using ‘\’ as separator is bad, and also they maybe stored as c:/data/ so using / is risky. I think using * or | maybe a good idea both because of they are illegal and they cannot be anywhere of a folder path and the string that has some folder paths concatenated is readable and can simply being recognized by see * or | as separator.

        String[] paths = s.Split(new char[]{'*'}, StringSplitOptions.RemoveEmptyEntries);
        listBox1.Items.AddRange(paths);
    

    where s is string of concatenated folder paths you have read from setting file.
    also you can use

            String[] paths = s.Split(new char[]{'*'}, StringSplitOptions.RemoveEmptyEntries);
            listBox1.DataSource = paths;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control that is hosting a winforms listbox. I am re-sorting
I have several winforms listbox controls I am hosting in a user control. The
I have a Winform app that has 16 SQL Connections currently stored in the
I'm making a winform in C# using Visual Studio 2008. Currently, I have a
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have an application that sends XML over TCP sockets from windows client
I have a c# winform application that uses SQL 2005 Express. The application creates
I have created a UserControl using a DevExpress XtraTreeList. Basically in this user control
I currently have speakers set up both in my office and in my living
I currently have an existing database and I am using the LINQtoSQL generator tool

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.