Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 07-12-2007, 03:38 AM   #1
Default Transfering ASP Session to ASPX Session


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_N AME"), "_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
kalim is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sessions in Aspx getting mixed up jet vedi Software 0 07-23-2009 07:25 PM
export aspx page to word format or pdf format as it is display in aspx page getmeaditi Software 0 03-10-2009 07:15 AM
how to access iframe from an aspx page eyal1234 Software 1 07-22-2008 10:57 AM
.NET stops compiling some aspx pages angelbrown Software 0 09-04-2006 01:48 PM
Enbedding aspx page into another aspx page and post back Naga_01 Software 0 06-06-2006 06:51 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46