System.Net.WebRequest.Create

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

I have the below code.. executing from .NET APP

System.Uri objUri;
System.Net.WebRequest objWebReq;
System.Net.WebResponse objResp;

try
{
objUri = new System.Uri(strWebLink);
objWebReq = System.Net.WebRequest.Create(objUri);
objResp = objWebReq.GetResponse();
objResp.Close();
objWebReq = null;
return true;
}
catch
{
objWebReq = null;
return false;
}

and a Software policy restriction, that prevents from accessing Internet
through IE.

It works ok ( I get return true when internet is present) if the strWebLink
is say www.mydomain.com/admintest.aspx , but if I give it as
www.mydomain.com/admintest.asmx it fails ( I get return false when internet
is present). All this happens on XP SP2 box.

what is the difference??

VJ
 
It would be much easier to answer your question if you will specify the
details about the exception...
 
Back
Top