Is it possible to write a binary file directly to the clipboard in .NET? (Rather than write it to a file and then copy it?) the file is not an executable but will be pasted to the desktop\folder for example.
Dim connection As New SqlConnection("Data Source=SERVER\SQL2008;Initial Catalog=NorthPole;Integrated Security=True")
Dim command As New SqlCommand("SELECT pcfFile FROM Items WHERE pcfFileName=@Filename", connection)
command.Parameters.AddWithValue("@Filename", filename)
connection.Open()
Dim FileData As Byte() = DirectCast(command.ExecuteScalar(), Byte())
Dim fileStream As New FileStream(System.IO.Path.GetTempPath & FileName, FileMode.Create)
fileStream.Read(FileData, 0, CInt(fileStream.Length))
fileStream.Close()
Clipboard.SetDataObject(New DataObject(System.Windows.Forms.DataFormats.FileDrop, FileData), True)
connection.Close()