Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 26th, 2006, 08:06 PM
Registered User
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default why File System GetAuditRules() returns null

Hi Folks,

I am trying to get information about File Auditing using ASP.NET.

I am trying to get that information on website but it doesn't work and return null

collection of FileSystemAuditRule. But when I try to use GetFileAccessRules() method. It

works fine and return valid collection. This is sure file has an audit active. and it should

return one record at least.

Why GetFileAccessRules() works and GetFileAuditRules() doesn't work. Is there any difference

between them while using?

If I am using wrong way to get file audit information then please let me know what is the

best way to check file auditing?

Please help me because due to this I am stuck. I would really appreciate your assistance.

I am using the following code to get file audit information.

string FileName = Server.MapPath("test.txt");

FileSecurity fSecurity = File.GetAccessControl(FileName);

foreach (FileSystemAuditRule ace in fSecurity.GetAuditRules(true, true, typeof(NTAccount)))


Console.WriteLine("\tIdentityReference.Value: " + ace.IdentityReference.Value);

Console.WriteLine("\tAuditFlags: " + ace.AuditFlags);

Console.WriteLine("\tRegistryRights: " + ace.RegistryRights.ToString());

Console.WriteLine("\tInheritanceFlags: " + ace.InheritanceFlags);

Console.WriteLine("\tIsInherited: " + ace.IsInherited);

Console.WriteLine("\tPropagationFlags: " + ace.PropagationFlags);



Waiting for your prompt and helpful reply with thanks in anticipation

G. Mustafa

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript getElementById returns null VictorVictor ASP.NET 2.0 Professional 15 January 15th, 2010 06:53 PM
writing into a file in linux file system anboss XSLT 6 June 19th, 2008 01:56 PM
getRealPath returns null in Fedora bbhutta Servlets 0 October 21st, 2005 07:20 AM
Access from a Dbase drop down returns NULL topshed Access 0 December 2nd, 2004 10:48 PM
Reading Files In - end of file and placing null djwicks C# 0 May 15th, 2004 11:23 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.