Link to home
Start Free TrialLog in
Avatar of QuinnDester
QuinnDesterFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Translate to C# from vb

How can i translate the following Class from ASP Classic vb to a C#.net Class

I am just learning C# translating between languages is beyond my capabilities at the moment i have no knowledge of VB

Thank you
Class ASPObjects
 
    'returns Request object variables
    'QType here represents a collection
    '   (QueryString, Form or <A class=iAs style="FONT-WEIGHT: normal; FONT-SIZE: 100%; PADDING-BOTTOM: 1px; COLOR: darkgreen; BORDER-BOTTOM: darkgreen 0.07em solid; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" href="#" target=_blank itxtdid="3809288">Server</A>(ServerVariables))
    Public Function GetRequestVariable(ByVal Key, ByVal QType)
        Select Case lcase(QType)
            Case "session"
                GetRequestVariable = CStr(session(Key))
            Case "querystring"
                GetRequestVariable = CStr(Request.QueryString(Key).Item)
            Case "form"
                GetRequestVariable = CStr(Request.Form(Key).Item)
            Case "server"
                GetRequestVariable = CStr(Request.ServerVariables(Key).Item)
            Case Else
                GetRequestVariable = CStr(Request(Key).Item)
        End Select
    End Function
 
    'returns Session object variables
    Public Function GetSessionVariable(ByVal Key)
        GetSessionVariable = Session(Key)
    End Function
 
    'sets Session object variable
    Public Function SetSessionVariable(ByVal Key, ByVal Value)
        Session(Key) = Value
        SetSessionVariable = ""
    End Function
 
    Public Function encodeURL(ByVal p_string)
        encodeURL = server.urlencode(p_string)
    End Function
 
End Class

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jinal
jinal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial