E
Ethan Strauss
Hi,
I have a C#.Net 2.0 web app which needs to be able to read a bunch of
files from a user's computer, but I have not be able to get it to do so
without "Access denied" errors.
The main piece of code is simple
List<FileInfo> AllFiles = new List<FileInfo>();
System.Security.Permissions.FileIOPermission MyPermissions = new
System.Security.Permissions.FileIOPermission
System.Security.Permissions.FileIOPermissionAccess.AllAccess,
ThisSourceDirectory.FullName);
MyPermissions.Assert();
foreach (FileInfo ThisFile in ThisSourceDirectory.GetFiles())
{
{
AllFiles.Add(ThisFile);
}
}
ThisSourceDirectory is on a networked drive to which everyone in the company
should have access.
I have set <identity impersonate = "true"/> in my web.config file.
The page is running from IIS from my machine and I have Integrated Windows
Authentication turned on.
I have logged in as another user and I can see that
System.Environment.UserDomainName & System.Environment.UserName seem to be
set correctly.
The lines above in which I create and assert "MyPermissions" run without any
complaints, but the next line (with "GetFiles"), gives me access denied
errors.
When I log in as myself, everything runs just fine.
I would appreciate any help.
Thanks!
Ethan
Ethan Strauss Ph.D.
Bioinformatics Scientist
Promega Corporation
2800 Woods Hollow Rd.
Madison, WI 53711
608-274-4330
800-356-9526
(e-mail address removed)
I have a C#.Net 2.0 web app which needs to be able to read a bunch of
files from a user's computer, but I have not be able to get it to do so
without "Access denied" errors.
The main piece of code is simple
List<FileInfo> AllFiles = new List<FileInfo>();
System.Security.Permissions.FileIOPermission MyPermissions = new
System.Security.Permissions.FileIOPermission
System.Security.Permissions.FileIOPermissionAccess.AllAccess,
ThisSourceDirectory.FullName);
MyPermissions.Assert();
foreach (FileInfo ThisFile in ThisSourceDirectory.GetFiles())
{
{
AllFiles.Add(ThisFile);
}
}
ThisSourceDirectory is on a networked drive to which everyone in the company
should have access.
I have set <identity impersonate = "true"/> in my web.config file.
The page is running from IIS from my machine and I have Integrated Windows
Authentication turned on.
I have logged in as another user and I can see that
System.Environment.UserDomainName & System.Environment.UserName seem to be
set correctly.
The lines above in which I create and assert "MyPermissions" run without any
complaints, but the next line (with "GetFiles"), gives me access denied
errors.
When I log in as myself, everything runs just fine.
I would appreciate any help.
Thanks!
Ethan
Ethan Strauss Ph.D.
Bioinformatics Scientist
Promega Corporation
2800 Woods Hollow Rd.
Madison, WI 53711
608-274-4330
800-356-9526
(e-mail address removed)