private void button1_Click(object sender, System.EventArgs e)
{
Clipboard.SetDataObject(textBox1.Text,true);
}
private void button2_Click(object sender, System.EventArgs e)
{
if(Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
textBox1.Text = Clipboard.GetDataObject().GetData(DataFormats.Text).ToString();
else
textBox1.Text = "The clipboad does not contain any text";
}
我使用 C# Windows 窗体应用程序编写此应用程序