Kod:
using System.Windows.Forms;
namespace Tweet_Atma_Programı
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int sayac = 0;
private **** button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked == false)
{
foreach (HtmlElement element in webBrowser1.D o c u m e n t.All)
{
if (element.GetAttribute("classname") == "t1-form tweet-form condensed")
{
element.SetAttribute("classname", "t1-form tweet-form");
}
if (element.Id == "tweet-box-home-timeline")
{
element.InnerText = richTextBox1.Text;
}
if (element.GetAttribute("classname") == "button-text tweeting-text")
{
element.InvokeMember("click");
}
}
}
else
{
richTextBox1.Enabled = false;
textBox1.Enabled = false;
button1.Enabled = false;
checkBox1.Enabled = false;
sayac = int.Parse(textBox1.Text);
timer1.Start();
}
}
private **** checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
textBox1.Visible = true;
}
else
{
textBox1.Visible = false;
}
}
private **** button1_Click_1(object sender, EventArgs e)
{
}
private **** timer1_Tick(object sender, EventArgs e)
{
sayac--;
textBox1.Text = sayac + "Kaldı";
if (sayac == 0)
{
foreach (HtmlElement element in webBrowser1.********.All)
{
if (element.GetAttribute("classname") == "t1-form tweet-form condensed")
{
element.SetAttribute("classname", "t1-form tweet-form");
}
if (element.Id == "tweet-box-home-timeline")
{
element.InnerText = richTextBox1.Text;
}
if (element.GetAttribute("classname") == "button-text tweeting-text")
{
element.InvokeMember("click");
}
}
richTextBox1.Enabled = true;
textBox1.Enabled = true;
button1.Enabled = true;
checkBox1.Enabled = true;
timer1.Stop();
}
