取得剪贴板上的内容

来源:互联网 发布:淘宝网微信号买卖 编辑:程序博客网 时间:2024/06/12 01:15
private void button1_Click(object sender, System.EventArgs e) { // Create a new instance of the DataObject interface. IDataObject data = Clipboard.GetDataObject(); // If the data is text, then set the text of the // TextBox to the text in the Clipboard. if (data.GetDataPresent(DataFormats.Text)) textBox1.Text = data.GetData(DataFormats.Text).ToString(); }
原创粉丝点击