PasteSite is open to the public, but with limited features. Register to be able to modify access rights, track your pastes and more...
If you prefer reading light text on a dark background to dark text on a light background, then you might want to try the dark theme.
"Untitled" by Anonymous [Plain Text]Actions: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
static void Main(string[] args)
{
string result = "http://www.youtube.com/watch?v=Vr6swr0_10Q";
HttpWebRequest loHttp = (HttpWebRequest)WebRequest.Create(result);
HttpWebResponse loWebResponse = (HttpWebResponse)loHttp.GetResponse();
StreamReader loResponseStream = new StreamReader(loWebResponse.GetResponseStream());
string youTubeVidName = "";
for (int j = 0; j < 50; j++)
{
youTubeVidName += loResponseStream.ReadLine();
}
loWebResponse.Close();
loResponseStream.Close();
Console.WriteLine(youTubeVidName);
// Crashes on the next line - <title> exists, so it shouldn't....
youTubeVidName = youTubeVidName.Remove(0, youTubeVidName.IndexOf("<title>" + 7));
youTubeVidName = youTubeVidName.Substring(0, youTubeVidName.IndexOf("</title>"));
Console.WriteLine(youTubeVidName);
Console.ReadLine();
}
|