N
Noulouk
Hello,
I need to verify if mms:// or rtsp:// urls exists.
I do like this for http:// :
public static bool GetPage(String url)
{
try
{
// Creates an HttpWebRequest for the specified URL.
HttpWebRequest myHttpWebRequest =
(HttpWebRequest)WebRequest.Create(url);
// Sends the HttpWebRequest and waits for a
response.
HttpWebResponse myHttpWebResponse =
(HttpWebResponse)myHttpWebRequest.GetResponse();
if (myHttpWebResponse.StatusCode ==
HttpStatusCode.OK)
return true;
// Releases the resources of the response.
myHttpWebResponse.Close();
}
catch(WebException e)
{
Console.WriteLine("\r\nWebException Raised. The
following error occured : {0}",e.Status);
}
catch(Exception e)
{
Console.WriteLine("\nThe following Exception was raised
: {0}",e.Message);
}
return false;
}
If I replace mms:// by http:// , I can check the url.
But the same code doesn't work for rtsp protocols.
I apreciate any help to learn how to request a mms:// and rtsp://
file.(just need to check if the url is not broken)
Thanks in advance for your help.
I need to verify if mms:// or rtsp:// urls exists.
I do like this for http:// :
public static bool GetPage(String url)
{
try
{
// Creates an HttpWebRequest for the specified URL.
HttpWebRequest myHttpWebRequest =
(HttpWebRequest)WebRequest.Create(url);
// Sends the HttpWebRequest and waits for a
response.
HttpWebResponse myHttpWebResponse =
(HttpWebResponse)myHttpWebRequest.GetResponse();
if (myHttpWebResponse.StatusCode ==
HttpStatusCode.OK)
return true;
// Releases the resources of the response.
myHttpWebResponse.Close();
}
catch(WebException e)
{
Console.WriteLine("\r\nWebException Raised. The
following error occured : {0}",e.Status);
}
catch(Exception e)
{
Console.WriteLine("\nThe following Exception was raised
: {0}",e.Message);
}
return false;
}
If I replace mms:// by http:// , I can check the url.
But the same code doesn't work for rtsp protocols.
I apreciate any help to learn how to request a mms:// and rtsp://
file.(just need to check if the url is not broken)
Thanks in advance for your help.