Hi,

I was wondering if it is possible through C# to get all the directories of a website.

Example:
A website called example.com/ has the directories example.com/john, example.com/jill, example.com/pinkelephantsocks, and I searched for the directories of example.com/ it would return those 3 directories.

Sorry if this isn't clear enough, any help is appreciated.

Thank you

If this website is yours, you can iterate through the directory structure with an ASP.NET page. I assume by the nature of the question, however, that you're wanting to go through other people's structures. The answer is no, there is no way to get every directory in their website. You can recursively go through directories they might reveal via hyperlinks, image tags, etc., but that involves downloading HTML content, parsing it out, finding links, downloading HTML content, parsing it, ad finitum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.