Last post Dec 04, 2017 10:20 AM by PatriceSc
Sep 01, 2012 01:56 PM|NonaSoft|LINK
I developed which is supposed to connect with a web page supplier a value on a php page in which that page gives data in return, I tested it on my computer it is working very well.
But when I deployed it it doesnt process anywhere that has to do with database.
But If I paste on the browser it does fine but the phone couldnt.
Below is the code
Public Shared Function StringFromURL(ByVal URL As String) As String
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(StreamFromURL(URL))
Dim f As String = sr.ReadToEnd()
Catch ex As Exception
Private Shared Function StreamFromURL(ByVal URL As String) As System.IO.Stream
Dim wReq As Net.WebRequest
wReq = WebRequest.Create(URL)
wReq.Timeout = 1020000
wReq.PreAuthenticate = True
Dim wres As WebResponse = wReq.GetResponse
No error but it would never fetch the record from the web for me though if I copy the same url and paste it on the web it will process.
Please who can tell me why?
Dec 04, 2017 10:20 AM|PatriceSc|LINK
And StringFromURL is called from? Do you check the return value? Turning an exception into a return value is often considered bad as it make easy to unintentionally hide exceptions or misinterpret what actually happens.
Before reading the code you should always first find what actually happens.