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 1109099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:10:55+00:00 2026-05-17T02:10:55+00:00

When I copy data from my application, I wrote a simple C# script to

  • 0

When I copy data from my application, I wrote a simple C# script to check what type it is. Apparently (and I expected that), it’s an array of strings:

       IDataObject data = Clipboard.GetDataObject();
       Console.WriteLine(data.GetFormats(true)); // writes "System.String[]"

Now when I extract the data like

      object o = data.GetData( "System.String[]" );

the resulting object stays null.

Why? How am I to extract the data?

  • 1 1 Answer
  • 1 View
  • 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-17T02:10:56+00:00Added an answer on May 17, 2026 at 2:10 am

    You are not supposed to put the CLR types as parameters. The parameter to GetData is just an identifier that can be anything, but there are some pre-defined formats which many programs use.

    What you probably want to do is use DataFormats.Text to retrieve the data in text form (i.e. a string). Note that this only works if the source of the clipboard contents actually provided data in this format, but most do so you should be safe.

    And, since text is such a common format, there’s even a convenience method to retrieve it in that format called Clipboard.GetText()

    EDIT: The string[] you get back when you call GetFormats is just an array of strings listing all the available formats. It’s not the actual clipboard data, it just tells you which format you can get it in when you do obj.GetData(). Look at that array in the debugger or print it in a foreach to see if there’s any format that is array-like.

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

Sidebar

Related Questions

i want copy pdf file from application path(/data/data/package name) to sdcard.for that i have
I'm trying to copy data from an array of character that send from main
I have a script that I am using to copy data from a table
I'm learing LINQ-to-SQL right now and i have wrote a simple application that define
So I'm making this android application, that needs to read data from user-provided CSV
I am trying to copy data from my MYSQL table to SQL Server using
How do I copy data from a Qstring list to a text file for
I'm currently trying to copy data from table into another by using a SELECT
I'm using INSERT INTO to copy rows of data from one table to another:
I have two arrays. I'd like to copy ranges of data from one of

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.