We help IT Professionals succeed at work.
Get Started

Workaround for Directory.GetDirectories on restrictive shared host

medsoos asked
Last Modified: 2013-12-25
Hi, I'm trying to upload an asp.net site that I didn't write to a shared host - GoDaddy.com. Apparently because of their restrictive security policies I am unable to read subdirectories within my own site. The code it's balking on is: Directory.GetDirectories - please see below. Is there any other way to get this information or does anyone have a way around this problem? GoDaddy's technical support knows very little about asp.net and can't help.


lsubbdirs = Directory.GetDirectories(ltargdirr);
		lprevfold = "STARTING FOLDER NAME" ;

		foreach(string ldirrname in lsubbdirs) {
			ldirrfold = ldirrname.Substring(12) ;
			if (ldirrfold.IndexOf("-XXX-")>0){
				if (ldirrfold.Substring(0,5)!= lprevfold.Substring(0,5)){
					foldlist.Items.Add(new ListItem("-------------------------","")) ;
					foldlist.Items.Add(new ListItem(ldirrfold,ldirrfold)) ;
					foldlist.Items.Add(new ListItem(ldirrfold,ldirrfold)) ;
			lprevfold = ldirrfold ;

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE