S
set
Hi All.
I have a problem with a small app that works on PC but doesn't work on WM
5.0 (iPAQ rx1950).
I detached the problem into a small function.
public void testAuth()
{
for (int i = 0; i < 5; ++i)
{
try
{
HttpWebRequest req =
(HttpWebRequest)WebRequest.Create(URL);
req.Timeout = 5000;
WebResponse resp = req.GetResponse();
StreamReader reader = new
StreamReader(resp.GetResponseStream());
string pageText = reader.ReadToEnd();
reader.Close();
resp.Close();
}
catch (WebException e)
{
DebugWriteLine("testAuth: web exception: " + e.Message +
" " + e.Status);
}
catch (Exception e)
{
DebugWriteLine("testAuth: exception: " + e.Message);
}
}
}
First iteration is OK, but for second and third I get
testAuth: web exception: The remote server returned an error: (404) Not
Found. ProtocolError
and for all subsequent tries I get
testAuth: web exception: The operation has timed-out. Timeout.
In the same time Internet Explorer works ok and shows URL response correctly
any num of times.
What could be a problem?
Thanks.
I have a problem with a small app that works on PC but doesn't work on WM
5.0 (iPAQ rx1950).
I detached the problem into a small function.
public void testAuth()
{
for (int i = 0; i < 5; ++i)
{
try
{
HttpWebRequest req =
(HttpWebRequest)WebRequest.Create(URL);
req.Timeout = 5000;
WebResponse resp = req.GetResponse();
StreamReader reader = new
StreamReader(resp.GetResponseStream());
string pageText = reader.ReadToEnd();
reader.Close();
resp.Close();
}
catch (WebException e)
{
DebugWriteLine("testAuth: web exception: " + e.Message +
" " + e.Status);
}
catch (Exception e)
{
DebugWriteLine("testAuth: exception: " + e.Message);
}
}
}
First iteration is OK, but for second and third I get
testAuth: web exception: The remote server returned an error: (404) Not
Found. ProtocolError
and for all subsequent tries I get
testAuth: web exception: The operation has timed-out. Timeout.
In the same time Internet Explorer works ok and shows URL response correctly
any num of times.
What could be a problem?
Thanks.