0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

神保町シアターをチェックする!

0
Posted at

小学館が経営している神保町シアターでは、いわゆる名画座的なラインアップを定期的に上映している。何度か見逃してしまった。
そこで、DVDやBlu-rayになっていないもう一度みたい映画を、定期的にチェックすることにした。
C#でWebブラウザを使って、タイマーでチェックする。
映画のタイトルを設定しておくと、そのタイトルを上映するときに警告してくれる。

namespace Movie
{
	public class CheckTheater
	{
		private void 神保町シアター(string movietitle)
		{
			if (webBrowser.Url.ToString().Contains("/program/"))
			{
				checktitle(movietitle);
				return;
			}

			HtmlElementCollection links = webBrowser.Document.Links;
			foreach (HtmlElement link in links)
			{
				string href = link.GetAttribute("href");
				if (href.Contains("/program/"))
				{
					webBrowser.Navigate(href);
					break;
				}
			}
		}

		private void checktitle(string movietitle)
		{
			HtmlElementCollection links = webBrowser.Document.Links;
			foreach (HtmlElement link in links)
			{
				string href = link.GetAttribute("href");
				if (link.InnerText.Contains(movietitle))
				{
					MessageBox.Show(movietitle);
					break;
				}
			}
		}
	}
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?