![]() |
|
|
|
#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_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 |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |