如果它们正在工作或不使用C#,如何查找链接(HTTP,RTMP,MMS,http,RTSP等) [英] how to find links(HTTP, RTMP, MMS, http, RTSP, etc.) if they are working or not using C#

查看:86
本文介绍了如果它们正在工作或不使用C#,如何查找链接(HTTP,RTMP,MMS,http,RTSP等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,





i正在开发窗口项目我想放一些网址(http,rtmp.rhsp,mms)和想知道他们是否工作不使用C#

直到我不能找到http但RTMP,MMS,RTSP没有运气。



我的代码





Hello ,


i am working on window project i want to put some url(http,rtmp.rhsp,mms)and whant to check if they working of not using C#
till not i am able find only for http but for RTMP, MMS, RTSP no luck .

my code


string url = "www.google.com";
           try
           {
               HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
               webRequest.Method = "GET";

               string responseData = string.Empty;
               HttpWebResponse httpResponse = (HttpWebResponse)webRequest.GetResponse();

               using (StreamReader responseReader = new StreamReader(httpResponse.GetResponseStream()))
               {
                   responseData = responseReader.ReadToEnd();
               }
               MessageBox.Show("found");
           }
           catch (System.Net.WebException ex)
           {
               MessageBox.Show("not found");
           }
       }



任何帮助我们都会赞赏



lakhan


any help will we appreciated

lakhan

推荐答案

我要理清它...





现在我正在使用Rtmpdup我运行命令来下载一段视频而不是如果我能够下载文件那么简单它的意思就是链接正在运行





i way to sort out it...


now i am using Rtmpdup i run command to Download a piece of video and than if i am able to Download file so simply its mean than link is running


public string RtmpURL(String Url)
       {
           var currentLocation = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);

           // Get the path for Sox and Lame external applications used for sound processing.
           string rtmpDump = Path.Combine(currentLocation, "Tool\\Rtmpdump\\rtmpdump.exe");
           string filepath = Path.Combine(currentLocation, "Tool\\Rtmpdump\\temp.flv");
           string Result;
           //const string rtmpDump = "D://rtmpdump.exe";
           string rtmpDumpArguments = " -v -r " + Url + " -o temp.flv -B 1";
           Result = RunExternalExe(rtmpDump, rtmpDumpArguments);


           var theFile = new FileInfo(filepath+"temp.flv");
           if (theFile.Exists && Result == "yes")
           {
               File.Delete(filepath);

               return "yes";
           }
           else
           {
               return "no";
           }




<pre lang="c#"><pre lang="c#">


这篇关于如果它们正在工作或不使用C#,如何查找链接(HTTP,RTMP,MMS,http,RTSP等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆