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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:05:26+00:00 2026-06-12T20:05:26+00:00

At the moment, I have a main folder which has 320 sub folders and

  • 0

At the moment, I have a main folder which has 320 sub folders and I’m saving those folder names into to sql server DB in a temporarytable. Then I retrieve that data, consume it, and then delete it.

To pullout folder names I use:

`List<string> FolderInfoList = Directory.GetDirectories(stringFolderPath).ToList();`

My temporary tablehas 2 columns (ID, Name), of which ID is an auto increment field.

Then I save name detail into a second table which will be resulted

enter image description here

After that I retrieve each and every folder name using the id, I use and I will delete after using it.

Since my manager requested me to not to use database, I need to find an alternative solution. I know there is a way using Dictionary function but I don’t know how to use it or how to assign a unique id for an individual folder name or when I retrieve all the folders name List function, I retrieve them as a list, not individually. I need to manipulate same function using any alternative method.

  • 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-06-12T20:05:27+00:00Added an answer on June 12, 2026 at 8:05 pm

    you could try the following… it will then assign a unique guid for each folder stored in a new class for you

    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Diagnostics;
    using System.DirectoryServices;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Management.Automation;
    using System.Management.Automation.Runspaces;
    
    namespace zielonka.co.uk.stackoverflow.com.samples.unique
    {
        class Program
        {
            public class info
            {
                public string name;
                public Guid uniqueID;
            }
            static void Main(string[] args)
            {
                List<string> FolderInfoList = Directory.GetDirectories("c:\\").ToList();
                List<info> uniqueFolders = new List<info>();
                foreach (var VARIABLE in FolderInfoList)
                {
                    uniqueFolders.Add(new info(){name = VARIABLE, uniqueID = new Guid()});
                }
                foreach (var uniqueFolder in uniqueFolders)
                {
                    Console.WriteLine(uniqueFolder.uniqueID+" "+uniqueFolder.name);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the moment I have a slider and an small input text box which
At the moment I have a jQuery do a POST to a Controller which
At the moment I have the following code which works fine. label = new
At the moment i have a stylesheet switcher which uses javascript to to load
I have a main report which contains user information -- and a subreport that
I'm using git for a personal project at the moment and have run into
I am in a position at the moment where I have a plugins folder
I have a main program which creates a collection of N child threads to
At the moment I have added and referenced another project to my main solution.
we have one main application, which executes up to 5 different exes. These exes

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.