[codebox]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;
using System.Threading;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox2.Equals(""))
return;
Thread thread = new Thread(SendText);
thread.Start();
}
private void SendText()
{
String text = textBox2.Text;
send = true;
while (send)
{
SendKeys.SendWait(text);
SendKeys.SendWait("{ENTER}");
System.Threading.Thread.Sleep(1000);
}
}
private void button2_Click(object sender, EventArgs e)
{
Send = false;
}
}
}[/codebox]