PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Translating VB.NET-code into C#.NET + ASP.NET
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Translating VB.NET-code into C#.NET + ASP.NET
![]() |
Translating VB.NET-code into C#.NET + ASP.NET |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
VB.NET:
Sub Application_AuthenticateRequest(sender As Object, e As EventArgs) If Request.IsAuthenticated Then 'Determine this user's roles Dim reader As SqlDataReader = _ SqlHelper.ExecuteReader(connection string, _ CommandType.StoredProcedure, "rolesForUser", _ New SqlParameter("@Username", User.Identity.Name)) ' Create an array of role names Dim roleList As New ArrayList Do While reader.Read() roleList.Add(reader("Name")) Loop 'Convert the roleList ArrayList to a String array Dim roleListArray As String() = roleList.ToArray(GetType(String)) 'Add the roles to the User Principal HttpContext.Current.User = _ New GenericPrincipal(User.Identity, roleListArray) End If End Sub Thanx e: Sjakie22@Skynet.be |
|
|
|
#2 |
|
Guest
Posts: n/a
|
* =?Utf-8?B?U2pha2ll?= <Sjakie@discussions.microsoft.com> scripsit:
Your question is 0 percent related to VB.NET programming. Consider posting it to the C# group. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

