Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1081785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:12:46+00:00 2026-05-16T22:12:46+00:00

Is it possible to write a binary file directly to the clipboard in .NET?

  • 0

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()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:12:46+00:00Added an answer on May 16, 2026 at 10:12 pm

    I’m not sure this is possible. By reading all the formatted data off of the Clipboard.GetDataObject, I was able to glean this from the information ( although it is VERY unclear to me ).

    This was ran with an executable named “LightMap.exe” in the root of C:\

    “⊘” denotes a byte of 0.

    Format "Shell IDList Array" contains: "⊘⊘⊘⊘⊘⊘;⊘⊘⊘⊘P�O� �:i��⊘+00�⊘/C:\⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘N⊘2⊘⊘`⊘⊘-=`� ⊘LIGHTY~1.EXE⊘⊘2⊘⊘⊘�-={�-={�⊘⊘⊘L⊘i⊘g⊘h⊘t⊘y⊘M⊘a⊘p⊘.⊘e⊘x⊘e⊘⊘⊘⊘⊘⊘"
    
    Format "FileDrop" contains: "C:\LightyMap.exe"
    
    Format "Preferred DropEffect" contains: "⊘⊘⊘"
    
    Format "Shell Object Offsets" contains: "⊘⊘⊘�⊘⊘⊘⊘⊘⊘⊘⊘⊘⊘"
    
    Format "FileName" contains: "C:\LIGHTY~1.EXE"
    
    Format "FileNameW" contains: "C:\LightyMap.exe"
    

    As you can see, there isn’t a whole lot of useful information here towards what you want to do, but it does give a glimpse of the internals.

    For instance, “Shell IDList Array” seems to have the path embedded in an 8.3 friendly form and a 0 byte delimited path towards the end, but if the path is large ( probably to exceed 88 bytes, such as C:\Documents And Settings\username\Desktop\LightyMap.exe ), it only contains the file name but not the path while the FileName and FileNameW remain correct.

    Formats with 0 bytes are IO.MemoryStream, text will either be String( ) or String, and so on.

    I do know that the offsets are related to if it should cut or copy the file, but aside from that, the rest is a mystery.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to write objects in Java to a binary file? The objects
Is it possible to write a doctest unit test that will check that an
Is it possible to write code in a Flex application that will only be
I think is it quite possible, but I'm not sure. I don't have the
I am using BinaryWriter class to write a binary file to disk. When I
I am using fopen to write to a binary file and using the cstdio
Is it possible to write to the windows logs in python?
Is it possible to write a regular expression that matches a nested pattern that
Would it be possible to write a class that is virtually indistinguishable from an
It's possible to write Markdown content with invalid syntax. Invalid means that the BlueCloth

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.