Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 820
Product
All Products
Version
All
Title
How do I check identity in an ASP.NET application?
Problem
It is important to make sure that the user account under which your ASP.NET application is running has the necessary NTFS permissions to any resources being accessed through the filesystem. If you are not sure which account is being used by your application, the .NET framework provides built-in classes which can be used to check the current identity.
Solution

The following C# example shows how to check which user account your application is running under:


<%@ Page language="C#"%>
<%@ Import Namespace="System.Security.Principal" %>
 
<script runat=server>
void Page_Load(object sender, EventArgs args)
{
 Response.Write (WindowsIdentity.GetCurrent().Name);
}
</script>
Related Links
OfficeWriter Home Page
Purchase OfficeWriter
OfficeWriter Reporting Services Integration
Latest OfficeWriter News

Created : 6/25/2004 4:21:32 PM (last modified : 6/25/2004 4:25:25 PM)
Rate this article!
Comments