new to C# - Directory.CreateDirectory error?

Ahelbling
Ahelbling used Ask the Experts™
on
Hello, I am new to C# and can't seem to figure out why I cannot use Directory.CreateDirectory in the user control code attached.  I have used it many times in VB.

SS
TIA,
Andrew
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AndyAinscowFreelance programmer / Consultant

Commented:
>>I have used it many times in VB.

Have you?  According to that error the SiteInfintyWebApp.UserControls.Directory does not contain a method called CreateDirectory.  (You might have used a different class in VB)

Author

Commented:
Ok, I am confused...

using System.IO; allows for use of  Directory.CreateDirectory("TEST");

No?

Author

Commented:
so?

System.IO.Directory.CreateDirectory("TEST");
Freelance programmer / Consultant
Commented:
Yes - BUT that isn't what you were using.  Look at the error.  You might need to explicitly use System.IO.Directory.CreateDirectory instead of Directory.CreateDirectory

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial