Check if mms:// or rtsp:// url exists

  • Thread starter Thread starter Noulouk
  • Start date Start date
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;
}

But the same code doesn't work for mms or rtsp protocols.

Thanks in advance for your help.
 
Do these protocols work in IE? If so, you could use monikers in COM
(through a call to CreateUrlMonikerEx through the P/Invoke layer and then a
call to BindToStorage). Unless someone has written it, there really isn't a
managed way to handle this. You will have to use interop. Unfortunately,
the interop you would have to use would be quite complicated.

I'd take a look at the documentation for the BindToStorage method on the
IMoniker interface in the MSDN documentation, since this is what you will
need to call.

Hope this helps.
 
Back
Top