using System;
using System.Diagnostics;
using System.Windows.Forms;
using System.Linq;

namespace CsvClipboard
{
public static class App
{
[STAThread]
public static void Main()
{
var csvData = new object[] {"Col 1", new DateTime( 2017, 10, 10), 123.32 };
var csvString = string.Join( "\t", csvData );
Clipboard.SetData( DataFormats.CommaSeparatedValue, csvString );

// What data type exists in clipboard now?
var data = Clipboard.GetDataObject();
var formats = data?.GetFormats();
formats?.ToList().ForEach( format => Debug.Print( format ) );
}
}
}

Advertisements