private void burauzackget() { mt.WaitOne(); if (comboBox1.SelectedIndex > -1) { Properties.Settings.Default.burauza = comboBox1.SelectedIndex; Properties.Settings.Default.Save(); ck = CookieGetter.CreateInstances(true)[comboBox1.SelectedIndex].GetCookie(new Uri("http://www.nicovideo.jp/"), "user_session"); if (ck == null) { MessageBox.Show("クッキーを取得できませんでした。\r\nブラウザでログインし直すか、ブラウザを再起動したり\r\n時間を置くなどして再度お試し下さい。"); button1.Enabled = false; } else { m_cc = new CookieContainer(); m_cc.Add(ck); button1.Enabled = true; } } mt.ReleaseMutex(); }
//クッキーゲット private void Form1_Shown(object sender, EventArgs e) { //ブラウザ設定 comboBox1.Items.AddRange(CookieGetter.CreateInstances(true)); if (Properties.Settings.Default.burauza > -1 && Properties.Settings.Default.burauza < comboBox1.Items.Count) { comboBox1.SelectedIndex = Properties.Settings.Default.burauza; } }
private void cbShowAll_CheckedChanged(object sender, EventArgs e) { lock (_asyncObj) { _ayncUpdateIndex = 0; backgroundWorker1.CancelAsync(); cmbBrowser.Items.Clear(); cmbBrowser.Items.AddRange(CookieGetter.CreateInstances(!cbShowAll.Checked)); if (cmbBrowser.Items.Count != 0) { cmbBrowser.SelectedIndex = 0; if (!backgroundWorker1.IsBusy) { backgroundWorker1.RunWorkerAsync(); } } } }
private void ckget() { if (comboBox1.SelectedIndex > -1) { ck = CookieGetter.CreateInstances(true)[comboBox1.SelectedIndex].GetCookie(new Uri("http://www.nicovideo.jp/"), "user_session"); if (ck == null) { textBoxhelp.Text = "ブラウザを選択して下さい。"; textBoxurl.Enabled = false; button1.Enabled = false; button3.Enabled = false; MessageBox.Show("クッキーを取得できませんでした。\r\nブラウザでログインし直すか、ブラウザを再起動したり\r\n時間を置くなどして再度お試し下さい。"); } else { m_cc = new CookieContainer(); m_cc.Add(ck); textBoxurl.Enabled = true; button3.Enabled = true; if (dataGridViewcom.Rows.Count > 0) { button1.Enabled = true; dataGridViewcom.Enabled = true; textBoxhelp.Text = "コミュニティを表から選択し管理開始を押してください。"; } else { button1.Enabled = false; dataGridViewcom.Enabled = false; textBoxhelp.Text = "コミュニティページにURLを入力しコミュ追加ボタンを押して下さい。"; } } } }
public Form1() { InitializeComponent(); comboBox1.Items.AddRange(CookieGetter.CreateInstances(true)); }
public Form1() { InitializeComponent(); //フォント設定 sftate.FormatFlags = StringFormatFlags.DirectionVertical; sftate.Alignment = StringAlignment.Center; sftate.LineAlignment = StringAlignment.Center; sftateue.FormatFlags = StringFormatFlags.DirectionVertical; sftateue.Alignment = StringAlignment.Near; sftateue.LineAlignment = StringAlignment.Center; sftatesita.FormatFlags = StringFormatFlags.DirectionVertical; sftatesita.Alignment = StringAlignment.Far; sftatesita.LineAlignment = StringAlignment.Center; sfnaka.Alignment = StringAlignment.Center; sfnaka.LineAlignment = StringAlignment.Center; sfnakaue.Alignment = StringAlignment.Center; sfnakasita.Alignment = StringAlignment.Center; sfnakasita.LineAlignment = StringAlignment.Far; sfnakahidari.Alignment = StringAlignment.Near; sfnakahidari.LineAlignment = StringAlignment.Center; sfnakamigi.Alignment = StringAlignment.Far; sfnakamigi.LineAlignment = StringAlignment.Center; openFileDialog1.InitialDirectory = Properties.Settings.Default.zensetteipath; saveFileDialog1.InitialDirectory = Properties.Settings.Default.zensetteipath; //重軽 trackBar1.Value = Properties.Settings.Default.omokaru; //184 /*m_mail = Properties.Settings.Default.h184; * if (m_mail == "184") * { * checkBox184.Checked = true; * } * else * { * checkBox184.Checked = false; * }*/ //バージョン取得 using (StreamReader sr = new StreamReader(new WebClient().OpenRead("http://space.geocities.jp/kenzanhaisin/nicojangversion.txt"), Encoding.GetEncoding("UTF-8"))) { version = sr.ReadToEnd(); } if (version == FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion.ToString()) { comboBox1.Enabled = true; comboBox1.Items.AddRange(CookieGetter.CreateInstances(true)); } s_sankasyaid.Add("-1"); s_sankasyagazouid.Add(""); }