posted on Thursday, February 26, 2004 7:08 PM by taylorza

What's in a language

Update: There is an updated C# version for .NET 2.0 here

For those that wanted a VB.NET version of the WindowsIdentity Role enumeration code here it is.

VB.NET

Public Shared Function GetWindowsIdentityRoles(ByVal identity As WindowsIdentity) As String()
 
Dim result As Object = GetType(WindowsIdentity).InvokeMember("_GetRoles", _
    BindingFlags.Static
Or BindingFlags.InvokeMethod Or BindingFlags.NonPublic, _
   
Nothing, identity, New Object() {identity.Token}, Nothing)

 
Return result
End Function

For the record I am not (that) biased to wards C# in fact my day job has me working in VB.NET 13 hours a day. It is the other 11 hours that I do C# and my blogs fall into the 11 hour period. I firmly believe in learning the environment in this case the .NET Platform and the language is merely a tool...

Comments