This commit is contained in:
58
Form1.cs
Normal file
58
Form1.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace WebChecker
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
WebBrowser wb = new WebBrowser();
|
||||
string url = "http://me.sayclub.com/profile/home/view/ban8";
|
||||
Timer m_Timer = new Timer();
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
m_Timer.Interval = 5000;
|
||||
m_Timer.Tick += new EventHandler(m_Timer_Tick);
|
||||
|
||||
wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted);
|
||||
}
|
||||
|
||||
void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
|
||||
{
|
||||
HtmlDocument doc = wb.Document;
|
||||
HtmlElement element = doc.GetElementById("sbVisitedUser");
|
||||
string strCnt = (string)element.InnerText.Clone();
|
||||
|
||||
strCnt = strCnt.Substring(0, strCnt.IndexOf("명"));
|
||||
strCnt = strCnt.Substring(strCnt.IndexOf("오늘")+"오늘".Length);
|
||||
strCnt = strCnt.Trim();
|
||||
|
||||
int iCnt = Convert.ToInt32(strCnt);
|
||||
|
||||
if(iCnt > 3)
|
||||
MessageBox.Show(iCnt + "명 : 확인해바라");
|
||||
}
|
||||
|
||||
void m_Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if(wb.IsBusy == false)
|
||||
wb.Navigate(url);
|
||||
}
|
||||
|
||||
private void Process_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(Process.Checked == true)
|
||||
m_Timer.Start();
|
||||
else
|
||||
m_Timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user