Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Browse by Tags

All Tags » Development » SQL   (RSS)
Sorry, but there are no more tags available to filter with.

  • Dealing with renamed/localized user/group names with managed code

    If you are a regular reader of Michael Kaplan (I know I am), you might have run across his What's in a name? (once more) post. He comments on the use of localized account names and points to the KB 157234, How to deal with localized and renamed user and group names . For those of you running on managed code, be happy - the code to get well-known accounts is much simpler. A little bit of SecurityIdentifer , a dash of WellKnownSidType , and you should be ready to go. // Build with: %windir%\Microsoft.Net\Framework\v2.0.50727\csc.exe foo.cs using System; using System.Security.Principal; class DoIt { public static void Main(string[] args) { WellKnownSidType[] knownSids = new WellKnownSidType[] { WellKnownSidType.LocalServiceSid, WellKnownSidType.NetworkServiceSid, WellKnownSidType.LocalSystemSid, WellKnownSidType.BuiltinAdministratorsSid, }; foreach(WellKnownSidType knownSid in knownSids) { SecurityIdentifier identifier = new SecurityIdentifier(knownSid, null); NTAccount account = (NTAccount)identifier.Translate(typeof(NTAccount)); Read More...
  • Transfer data to an Excel workbook programmatically

    Just today I came across this excellent Knowledge Base article: How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET It discusses a number of methods to get the task done, and seeing them all together in one page is quite handy. With the new Office Open XML file formats , however, there is yet another lightweight alternative for generation that combines rich formatting (which is missing in comma-separated value generation) with the ability to run without Excel running in the process (great for ASP.NET-like scenarios). Very, very cool stuff. Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us