I have a web service that I talk to PDA. In the same directory as Webservice asmx file, I have an HTML file, so that I can drag a web request to see if a directory is available.
I use the following code:
/// & lt; Summary & gt; /// puts a web request for connectivity checks /// & lt; / Summary & gt; Private Static WebRequest m_WebRequest; /// & lt; Summary & gt; /// Examines the connection to the provided URL; /// & lt; / Summary & gt; /// & lt; Param name = "url" & gt; URL to test & Lt; / Param & gt; If the URL is resolved then /// & lt; Returns & gt; truth. & Lt; / Returns & gt; Public Static Bull Test URL (string url) {try URL // URL is valid URL =. ("Http: \\", "http: //"); Url = url.Replace ("\\", "/"); // Request m_WebRequest = WebRequest.Create (url); M_WebRequest.Timeout = 30000; // Receive Request HttpWebResponse Feedback = (HttpWebResponse) m_WebRequest.GetResponse (); Back true; } Hold {m_WebRequest.Abort (); return false; }}
The file I am getting the response is always the same and always available from my PC. It is only failing when the web service (same directory in the same directory ) Errors in this can be related to it?
Alternatively, is there a better way to see if that file exists on the web?
I have done something that relates to the relationship between PDA and the Internet. WebRequest automatically opens GPRS / HSDPA connection, maybe there is a problem at that level.
Comments
Post a Comment