clipboard

“Current thread must be set to single thread apartment (STA)” error in copy string to clipboard

夙愿已清 提交于 2019-12-06 17:17:43
问题 I have tried code from How to copy data to clipboard in C#: Clipboard.SetText("Test!"); And I get this error: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. How can I fix it? 回答1: Make sure thread that runs the code is marked with [STAThread] attribute. For WinForm and console based apps it is generally Main method Put [STAThread] above your main method: [STAThread] static void

Flutter can't read from Clipboard

自作多情 提交于 2019-12-06 16:46:18
问题 I come asking for quite a specific question regarding Flutter and the Future and await mechanism, which seems to be working, but my Clipboard does not really function while operating with my editable text fields, even following Google's advice on implementation... This is my code for pasting: onPressed: () async { await getMyData('text'); _encodingController.text = clipData; Scaffold.of(context).showSnackBar( new SnackBar( content: new Text( "Pasted from Clipboard"), ), ); }, what doesnt work

Multiple lines of text to clipboard

孤人 提交于 2019-12-06 15:59:25
Is there a way to send multiple lines of text to the clipboard using javascript? IE, I want to send: abc def ghi and not abcdefghi (and although right now i need to learn how to do it in Javascript, I would not mind hearing how it is done in other languages, like python) Send it as one string with carriage return and line feed characters in it, as Russ suggested. You replied to Russ that, "it does not work": what's the symptom of it not working? If you're copying from the clipboard into HTML, note that whitespace (especially including carriage return and line feed characters) is not

Is it possible to fully mimic clipboard functionality using the chrome extension APIs?

江枫思渺然 提交于 2019-12-06 15:50:14
Subject: I'm in the process of creating a chrome extension and, for certain features, I would like to copy some text to the clipboard and automatically paste it into whatever element has the focus for the user. Getting my text into the clipboard is no problem. I can simply create a textarea in my background page, set its value accordingly and then select it's contents. Then, I can use document.execCommand("copy"); Problem: The problem comes when I try to use document.execCommand('paste') in my content script. It works fine on simple text areas (like the one I'm typing in now). However, on many

Clipboard.GetData() returns null when it should not

て烟熏妆下的殇ゞ 提交于 2019-12-06 15:37:55
I am copying cells from an excel document to the clipboard so they can be inserted as an image elsewhere. The cells get copied to the clipboard fine, as I can paste the image manually after the code is run. However I cannot get ahold of the data. Here is my code: tempWorkSheet.Range[tempWorkSheet.Cells[1, 1], tempWorkSheet.Cells[3, 3]].CopyPicture(Excel.XlPictureAppearance.xlScreen, Excel.XlCopyPictureFormat.xlPicture); // returns true var test = Clipboard.GetDataObject().GetDataPresent(DataFormats.EnhancedMetafile); // returns true var test2 = Clipboard.ContainsData(DataFormats

Safari browser doesn't support document.execCommand('copy'); command?

前提是你 提交于 2019-12-06 14:13:56
问题 Can you please guide me on how to fix following issue, or suggest another option for copying to the clipboard? function click_to_copy_password(containerid) { if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(document.getElementById(containerid)); range.select(); } else if (window.getSelection) { var range = document.createRange(); range.selectNode(document.getElementById(containerid)); window.getSelection().removeAllRanges(); window.getSelection()

C# saving and then retriving data via the clipboard

爷,独闯天下 提交于 2019-12-06 14:06:56
Okay, So I have a program that automatically copies data to the clipboard and then into memory. What I want to do is, to save the data that is on the clipboard prior to my program running and then to copyit back to the clipboard once I have finished what I need to do. I can get the data fromt he clipboard as such: IDataObject currentClipboard = Clipboard.GetDataObject(); However, when I want to put the data back on to the clipboard, do I need to know what format that data is in to cast it? Is there a way to do this? Thanks. E.J. Brennan See this post, it might have what you need: Strangeness

Copying File From Unix To Windows Clipboard [closed]

て烟熏妆下的殇ゞ 提交于 2019-12-06 13:40:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to copy a large file from a Unix server to the Windows clipboard using SSH. How can this be done? I can't install any third party application on the server I tried various options like %y+ But none of them working for me. UPDATE : Finally i used scp on windows cygwin and it worked like charm Thanks 回答1:

How to copy some specific SMS content into clipboard? [closed]

假装没事ソ 提交于 2019-12-06 13:30:35
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 5 years ago . The bank that I'm working with sends me an SMS containing a random generated six digit code whenever I want to enter for checking my accounts. And everytime it is really tiring to type it manually. I'm thinking about making a little application in order to copy that six digit number into the clipboard so that I paste it instantly to the related field whenever an SMS arrives.

Copy to clipboard not working on FireFox

拜拜、爱过 提交于 2019-12-06 13:13:33
I had implemented copy to clipboard functionality. It is working fine with all version on IE but not working in FireFox. Please help me solve out this problem. Detail are <script src="../../Scripts/JQPlugins/jquery.clipboard.js" type="text/javascript"></script> <script src="../../Scripts/JQPlugins/jquery.clipboard.pack.js" type="text/javascript"></script> <script type="text/javascript"> $.clipboardReady(function() { $("input#buttonid").bind('click', function() { var text = $("#url").attr("href") + "\n" + $("#pwd").html(); $.clipboard(text); alert("hi"); return false; }); }, { swfpath: "../..