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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:24:44+00:00 2026-06-13T12:24:44+00:00

Possible Duplicate: How can i get a string and return each time a string

  • 0

Possible Duplicate:
How can i get a string and return each time a string from array?

I have this function :

private List<string> getLinks(HtmlAgilityPack.HtmlDocument document)
        {

            List<string> mainLinks = new List<string>();
            var linkNodes = document.DocumentNode.SelectNodes("//a[@href]");
            if (linkNodes != null)
            {
                foreach (HtmlNode link in linkNodes)
                {
                    var href = link.Attributes["href"].Value;
                    if (href.StartsWith("http://") == true || href.StartsWith("https://") == true || href.StartsWith("www") == true) // filter for http 
                    {
                        mainLinks.Add(href);
                    }
                }
            }

            return mainLinks;

        }

Its getting one url and return list of url’s.
Instead i want that the function will get a directory for example c:\
And it will return me a List of all directories in c:\
Not subsirectories just the directories in c:\ in my case it should be a List with a 14 directories.

Meaning in each index in the List a directory.

How can i do it ? Tried with Directory and DirectoryInfo but i just got messed up.

  • 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-13T12:24:45+00:00Added an answer on June 13, 2026 at 12:24 pm

    The static method Directory.EnumerateDirectories(string path) returns

    An enumerable collection of the full names (including paths) for the directories in the directory specified by path.
    

    Source: MSDN

    You can use the methods in the class Path to get the name of a directory, e.g. Path.GetDirectoryName(string path). Read the documentation carefully at MSDN.

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

Sidebar

Related Questions

Possible Duplicate: Splitting a string in C++ I have this vector function from one
Possible Duplicate: Is there a JavaScript function that can pad a string to get
Possible Duplicate: How can I get a list of all the defined variables in
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: Can I get more than 1000 records from a DirectorySearcher in Asp.Net?
Possible Duplicate: Removing carriage return and new-line from the end of a string in
Possible Duplicate: Modifying C string constants? can you explain why i get access violation
Possible Duplicate: How can I get this ASP.NET MVC SelectList to work? What the
Possible Duplicate: How can I get the source code of a Python function? First,
Possible Duplicate: How can I decrypt this encryption routine? I have been on this

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.