P
prakash
Dear ALL
I am write an application for pocketpc . I use visual studio 2003.
I want to get a response string of an ASP web request query
I try this function
Public Shared Function GetResponseStringA(ByVal RemoteURL As String)
As String
Dim StartTime As DateTime = DateTime.Now()
Dim DownloadContent As String
Dim objRequest As Net.WebRequest, objResponse As Net.WebResponse,
objStreamReceive As System.IO.Stream, objEncoding As
System.Text.Encoding, objStreamRead As System.IO.StreamReader
Try
DownloadContent = ""
objRequest = Net.WebRequest.Create(RemoteURL)
objResponse = objRequest.GetResponse
objStreamReceive = objResponse.GetResponseStream
objEncoding = System.Text.Encoding.GetEncoding("utf-8")
objStreamRead = New System.IO.StreamReader(objStreamReceive,
objEncoding)
DownloadContent = objStreamRead.ReadToEnd()
If Not objResponse Is Nothing Then
objResponse.Close()
End If
Return DownloadContent
Catch ex As Exception
msgbox(ex.message)
End Try
End Function
--------------------------------------------------------------
This function works finely for few times
After five or six times . It hangs on the line
objResponse = objRequest.GetResponse.
How to fix that problem
bye
Prakash
I am write an application for pocketpc . I use visual studio 2003.
I want to get a response string of an ASP web request query
I try this function
Public Shared Function GetResponseStringA(ByVal RemoteURL As String)
As String
Dim StartTime As DateTime = DateTime.Now()
Dim DownloadContent As String
Dim objRequest As Net.WebRequest, objResponse As Net.WebResponse,
objStreamReceive As System.IO.Stream, objEncoding As
System.Text.Encoding, objStreamRead As System.IO.StreamReader
Try
DownloadContent = ""
objRequest = Net.WebRequest.Create(RemoteURL)
objResponse = objRequest.GetResponse
objStreamReceive = objResponse.GetResponseStream
objEncoding = System.Text.Encoding.GetEncoding("utf-8")
objStreamRead = New System.IO.StreamReader(objStreamReceive,
objEncoding)
DownloadContent = objStreamRead.ReadToEnd()
If Not objResponse Is Nothing Then
objResponse.Close()
End If
Return DownloadContent
Catch ex As Exception
msgbox(ex.message)
End Try
End Function
--------------------------------------------------------------
This function works finely for few times
After five or six times . It hangs on the line
objResponse = objRequest.GetResponse.
How to fix that problem
bye
Prakash