我想得到你管视频信息。所以我准备了网址并将其称为以下
String YouTubeVideoInfo = "www.youtube.com/get_video_info?video_id=" + FinalVideoId;
**WebRequest HttpWReq = (WebRequest)WebRequest.Create(YouTubeVideoInfo);**
WebResponse HttpWResp = (WebResponse)HttpWReq.GetResponse();
Stream stream = HttpWResp.GetResponseStream();
StreamReader reader = new StreamReader(stream);
string contents = reader.ReadToEnd();
但是上面的代码给出了错误。所以我只想知道是否有任何方法可以在不添加协议(http,https)
的情况下调用此URL答案 0 :(得分:3)
WebRequest
如何知道协议?因为它确实缺少协议部分,因此你不能将它作为URI传递给任何需要它的东西。