GDI + LINQ = Generate a bar graph in a single line of code

This is a simplified version of actual code from an app I’m working on.  There are a few lines of setup, and then the cool part (the last statement): Using a select statement to iterate over a List<double>, creating a RectangleF object for each value, packaging them all into an Array, and passing the array…

3

Code Snippet: Setting NTFS permissions

My previous post shows how to use Windows32.Security to read and set permissions to the registry.  Doing the same for a NTFS is even simpler: public bool TestNTFSPermissions(string path, string userName) {       SecurityDescriptor secDesc = SecurityDescriptor.GetFileSecurity(path, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION);       Dacl dacl = secDesc.Dacl;       return TestAcl(dacl, userName); }     public void SetNTFSPermissions(string path, string userName)…

2

Code Snippet: Working with Permissions (ACLs/ACEs) in C# under .Net 1.1

I’ve been working lately on adding “self-healing” capabilities to a certain application.  The idea is to create a set of utility functions which will validate (and fix if needed) various environmental settings such as NTFS permissions, registry permissions, IIS metabase settings, etc.  None if this is rocket science but there still was some work involved…

3