How to get attributes from a directory

A

Alex D.

Is there something wrong in this code? :
try

{

DirectoryInfo dirInfo = new DirectoryInfo(path);

if ((FileAttributes.Hidden & dirInfo.Attributes) == FileAttributes.Hidden)
{ Response.Write("The folder is hidden."); }

}

catch (Exception) { }


When try to execute I get a blank page with the message:
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.

Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur.

Thanks, Alex.
 
A

Alex D.

I found the error....the code works just fine..it was just a property with a
bad definition.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top