Q: convert to C#

Discussion in 'ASP .Net' started by =?Utf-8?B?SklNLkgu?=, Mar 17, 2005.

  1. Hello,
    This is the way I can catching my group name from AD collection.

    If UCase(pKey) = "MEMBEROF" And UCase(pCollection) Like
    "CN=MYGROUP_*" Then
    ADUserMYGROUP = Mid(pCollection, 11, 3)
    Return ADUserMYGROUP
    End If

    It seems like is not recognizable by C#, how would you do it in C#?
    Thanks,
    Jim.
    =?Utf-8?B?SklNLkgu?=, Mar 17, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?SklNLkgu?=

    Karl Seguin Guest

    Re: convert to C#

    if (pkey.ToUpper() == "MEMBEROF" &&
    pCollection.ToUpper().IndexOf("CN=MYGROUP_") == 0)
    {
    string userGroup = pCollection.Substring(11,3);
    }


    Karl


    Microsoft.VisualBasic for the win!!!

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "JIM.H." <> wrote in message
    news:...
    > Hello,
    > This is the way I can catching my group name from AD collection.
    >
    > If UCase(pKey) = "MEMBEROF" And UCase(pCollection)

    Like
    > "CN=MYGROUP_*" Then
    > ADUserMYGROUP = Mid(pCollection, 11, 3)
    > Return ADUserMYGROUP
    > End If
    >
    > It seems like is not recognizable by C#, how would you do it in C#?
    > Thanks,
    > Jim.
    >
    Karl Seguin, Mar 17, 2005
    #2
    1. Advertising

  3. JIM.H,
    Is your code doing forms authentication against Active Directory?
    Cos i'm interested in doing something related by validating users
    against ROLES in the Active directory using forms Authentication.
    i.e if a USER logs on and the user doesn't belong to ROLES A in the
    Active Directory redirect to anoter page or do something else..
    Any ideas?


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Mar 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    1
    Views:
    393
    Karl Seguin
    Jul 23, 2003
  2. Jaap
    Replies:
    4
    Views:
    710
    John O'Conner
    Jul 10, 2006
  3. Klaus Neuner
    Replies:
    7
    Views:
    488
    Klaus Neuner
    Jul 26, 2004
  4. sck10
    Replies:
    4
    Views:
    16,003
    daniel
    Sep 3, 2006
  5. Replies:
    5
    Views:
    1,928
    Wesley Hall
    Nov 4, 2006
Loading...

Share This Page