How to paste CSV data to Windows Clipboard with C#

后端 未结 3 442
暖寄归人
暖寄归人 2020-12-24 11:59

What I\'m trying to accomplish

  • My app generates some tabular data
  • I want the user to be able to launch Excel and click \"paste\" to place the data a
3条回答
  •  萌比男神i
    2020-12-24 12:49

    Use tabs instead of commas. ie:

    Clipboard.SetText("1\t2\t3\t4\t3\t2\t3\t4", TextDataFormat.Text);
    

    Just tested this myself, and it worked for me.

提交回复
热议问题