Click here to Skip to main content
16,005,120 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionText search from database Pin
amit20119-Sep-08 5:21
amit20119-Sep-08 5:21 
AnswerRe: Text search from database Pin
Manas Bhardwaj9-Sep-08 5:27
professionalManas Bhardwaj9-Sep-08 5:27 
AnswerRe: Text search from database Pin
amit20119-Sep-08 5:54
amit20119-Sep-08 5:54 
AnswerRe: Text search from database [modified] Pin
Rutvik Dave9-Sep-08 6:28
professionalRutvik Dave9-Sep-08 6:28 
Questionhow to implement single signon service? Pin
srinivassam9-Sep-08 4:48
srinivassam9-Sep-08 4:48 
AnswerRe: how to implement single signon service? Pin
Manas Bhardwaj9-Sep-08 5:28
professionalManas Bhardwaj9-Sep-08 5:28 
QuestionASP.NET Treeview not refreshing Pin
Blumen9-Sep-08 4:46
Blumen9-Sep-08 4:46 
QuestionDirectory/File Permissions with ASP.NET Pin
Lea Hayes9-Sep-08 4:36
Lea Hayes9-Sep-08 4:36 
Hi guys!

I have just created a simple user control which displays a directory listing of a specified root location on the server.

I then discovered that the Directory.GetDirectories and Directory.GetFiles methods ignore the access permissions of the logged in user. So, even though the user may not be able to view a particular resource, it is still being shown within the directory listing.

What I want to do is somehow filter out directories and files which the user does not have access to.

I am controlling directory/file access via 'Web.config' files. And this works a treat. I just cannot find an option to verify whether a user has access to a particular directory or not. Below is some pseudo-code which describes what I am trying to achieve, but I do not know what goes in the two if statements.
string[] dirs = Directory.GetDirectories(rootPath);
string[] files = Directory.GetFiles(rootPath);

// Fetch directories and files.
foreach (string dirPath in dirs)
{
    if (Page.User is allowed to access dirPath)
    {
       // Render directory entry.
    }
}
foreach (string filePath in files)
{
    if (Page.User is allowed to access filePath)
    {
        // Render file entry.
    }
}


Any advice would be greatly appreciated Smile | :)

Thanks,
Lea Hayes
AnswerRe: Directory/File Permissions with ASP.NET Pin
Manas Bhardwaj9-Sep-08 5:31
professionalManas Bhardwaj9-Sep-08 5:31 
GeneralRe: Directory/File Permissions with ASP.NET Pin
Lea Hayes9-Sep-08 12:06
Lea Hayes9-Sep-08 12:06 
Questioni want to connect Secure Ftp(SFTP) through my web application...... Pin
Shaik Haneef9-Sep-08 4:15
Shaik Haneef9-Sep-08 4:15 
Questionwhat is the problem with this piece of code? Pin
snouto9-Sep-08 3:12
snouto9-Sep-08 3:12 
AnswerRe: what is the problem with this piece of code? Pin
Manas Bhardwaj9-Sep-08 3:31
professionalManas Bhardwaj9-Sep-08 3:31 
QuestionSID is same for every User Pin
Piyush Vardhan Singh9-Sep-08 2:01
Piyush Vardhan Singh9-Sep-08 2:01 
QuestionReading from excel file. Pin
hemant.kaushal9-Sep-08 1:50
hemant.kaushal9-Sep-08 1:50 
AnswerRe: Reading from excel file. Pin
Dilip H. Patel9-Sep-08 2:08
Dilip H. Patel9-Sep-08 2:08 
GeneralRe: Reading from excel file. Pin
hemant.kaushal9-Sep-08 3:01
hemant.kaushal9-Sep-08 3:01 
QuestionHow to find Password from Active directory using SID? Pin
sumit70349-Sep-08 1:14
sumit70349-Sep-08 1:14 
AnswerRe: How to find Password from Active directory using SID? Pin
Ashfield9-Sep-08 1:49
Ashfield9-Sep-08 1:49 
GeneralRe: How to find Password from Active directory using SID? Pin
sumit70349-Sep-08 1:56
sumit70349-Sep-08 1:56 
GeneralRe: How to find Password from Active directory using SID? Pin
Ashfield9-Sep-08 4:37
Ashfield9-Sep-08 4:37 
AnswerRe: How to find Password from Active directory using SID? Pin
Abhijit Jana9-Sep-08 17:58
professionalAbhijit Jana9-Sep-08 17:58 
Questioncreating dynamic pages in asp.net c# Pin
VijayVishwakarma9-Sep-08 0:32
VijayVishwakarma9-Sep-08 0:32 
AnswerRe: creating dynamic pages in asp.net c# Pin
eyeseetee9-Sep-08 0:46
eyeseetee9-Sep-08 0:46 
GeneralRe: creating dynamic pages in asp.net c# Pin
VijayVishwakarma9-Sep-08 0:50
VijayVishwakarma9-Sep-08 0:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.