Transfering ASP Session to ASPX Session

Discussion in 'Software' started by kalim, Jul 12, 2007.

  1. kalim

    kalim

    Joined:
    Jul 12, 2007
    Messages:
    1
    I have a problem in transferring my asp session to aspx session, can somebody help me ?
    Here is my code

    ******** I put this in page_load function ********************
    Dim mlHTTP As HttpContext
    Response.Write("result : " & mlXML.ExecuteUrl(Request.ServerVariables("SERVER_NAME"), "_transfersession.asp", mlHTTP.Current.Request))
    ****************************************************

    Public Function ExecuteUrl(ByVal server As String, ByVal page As String, ByVal mlrequest As System.Web.HttpRequest) As String


    Dim ipHostInfo As IPHostEntry = Dns.Resolve(server)
    Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
    Dim ipe As IPEndPoint = New IPEndPoint(ipAddress, 80)
    Dim socket As Socket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

    socket.Connect(ipe)

    Dim strRequest As String = "GET /" + page + " HTTP/1.1\r\n" & _
    "Host: " & server & "\r\n" & _
    "Connection: Close\r\n" & _
    "Cookie: " & mlrequest.Headers("Cookie") & "\r\n" & _
    "User-Agent: " & mlrequest.Headers("User-Agent") & "\r\n\r\n"


    Dim bytesSend As Byte() = Encoding.ASCII.GetBytes(strRequest)

    socket.Send(bytesSend, bytesSend.Length, SocketFlags.None)


    Dim bytes() As Byte = New Byte(256) {}
    Dim nBytes As Integer = 0
    Dim receive As String = ""
    Dim xml As String = ""


    Do
    nBytes = socket.Receive(bytes, bytes.Length, 0)
    receive += Encoding.ASCII.GetString(bytes, 0, nBytes)
    If (nBytes > 0) Then Exit Do
    Loop



    xml = receive
    'xml = receive.Substring(receive.IndexOf("<?xml"), receive.Length - receive.IndexOf("<?xml"))

    socket.Shutdown(SocketShutdown.Both)
    socket.Close()

    Return xml
    End Function
     
    kalim, Jul 12, 2007
    #1
    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. Naga_01
    Replies:
    0
    Views:
    1,453
    Naga_01
    Jun 6, 2006
  2. bqmassey

    Storing class with session (ASP.Net)

    bqmassey, Sep 22, 2006, in forum: Software
    Replies:
    0
    Views:
    1,177
    bqmassey
    Sep 22, 2006
  3. imman

    session from asp to asp.net

    imman, Feb 20, 2008, in forum: General Computer Support
    Replies:
    0
    Views:
    957
    imman
    Feb 20, 2008
  4. Armando Ruiz

    default.aspx or login aspx?

    Armando Ruiz, Jun 22, 2004, in forum: MCAD
    Replies:
    0
    Views:
    466
    Armando Ruiz
    Jun 22, 2004
  5. getmeaditi
    Replies:
    0
    Views:
    1,766
    getmeaditi
    Mar 10, 2009
Loading...

Share This Page