CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2007
    Posts
    1

    Another newb with some quick Error

    Try
    Dim authTicket As FormsAuthenticationTicket = _
    FormsAuthentication.Decrypt(authCookie.Value)
    Dim roles = authTicket.UserData
    Dim userIdentity As GenericIdentity = _
    New GenericIdentity(authTicket.Name)
    Dim userPrincipal As GenericPrincipal = _
    New GenericPrincipal(userIdentity, roles)
    Context.User = userPrincipal
    Catch ex As Exception

    End Try

    Error 1 Value of type 'String' cannot be converted to '1-dimensional array of String'. C:\xxx

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Another newb with some quick Error

    [ Redirected ]

  3. #3
    Join Date
    Dec 2009
    Posts
    2

    Re: Another newb with some quick Error

    redirected to where?

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Another newb with some quick Error

    Erm.... VB.NET

  5. #5
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Another newb with some quick Error

    sometimes it's good to follow the examples from the msdn
    http://msdn.microsoft.com/en-us/libr...principal.aspx

    Code:
    Dim roles(1) As String
    roles(0) = authTicket.UserData
    Dim userPrincipal As GenericPrincipal = New GenericPrincipal(userIdentity, roles)
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured