Here is how you check the user ids that are used within page's execution context. It is thread's current principle ( please verify this) needs access to the file that you are looking to access.
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<Script runat="Server">
private void Page_Load(object sender, System.EventArgs e)
{
lblUser.Text = Page.User.Identity.Name;
lblWindow.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
lblThread.Text = System.Threading.Thread.CurrentPrincipal.Identity.Name;
}
</Script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form runat="Server">
Page Identity : <asp:label id="lblUser" runat="server" text="RRRR" /><br>
Windows Identity : <asp:label id="lblWindow" runat="server" text="RRRR" /><br>
Thread Identity : <asp:label id="lblThread" runat="server" text="RRRR" /><br>
</form>
</body>
</html>
HTH
Thajeer
"Dont forget to click "Mark as Answer" on the post that helped you. This marks your thread as Resolved and the community will know you have been helped."