PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Translating VB.NET-code into C#.NET + ASP.NET

Reply

Translating VB.NET-code into C#.NET + ASP.NET

 
Thread Tools Rate Thread
Old 10-08-2004, 11:49 AM   #1
=?Utf-8?B?U2pha2ll?=
Guest
 
Posts: n/a
Default Translating VB.NET-code into C#.NET + ASP.NET


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
  Reply With Quote
Old 10-08-2004, 12:23 PM   #2
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Translating VB.NET-code into C#.NET + ASP.NET

* =?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/>
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off