I want to save a string to "copy" memory in computer (ctrl + c), after clicking a button. how can I save that string to the computer memory (ctrl c) in c#?
Asked
Active
Viewed 360 times
-4
-
1In the time it took you to create an account, login, post your question, you could have used Google to get an answer. – Steve Wellens Mar 27 '16 at 15:24
-
1The word you're looking for is 'clipboard'. If you search for "how to save string to clipboard with c#" you'll find lots of results. – user1751825 Mar 27 '16 at 15:25
-
thanks @user1751825 , I found the answer after searching "clipboard". – ComputerAsker Mar 27 '16 at 15:25
-
yeah I just didn't know the word "clipboard" before so I couldn't find an answer but now I got it... @WaiHaLee – ComputerAsker Mar 27 '16 at 20:58
-
Aha. You could accept the duplicate for this question if it helps you. – Wai Ha Lee Mar 27 '16 at 20:59
1 Answers
0
Reference System.Windows.Forms
if it is not already referenced in the project. Then do the magic anywhere you need:
System.Windows.Forms.Clipboard.SetText("your string");

Diligent Key Presser
- 4,183
- 4
- 26
- 34