✅ Clipboard.SetText in a ConsoleApp
Well, as a little task I'm trying to code a ConsoleApp that should base64 encrypt an input string and automatically copy it to the clipboard.
The ideal result is the following, by cmd:
What I'm unable to do, and that I always did in VB.NET Winforms, is Clipboard.SetText and I'm surprised to know that's strictly related to WinForms, since we're not talking abuot a button, or a textbox, but about the clipboard, that's global and abstract.
Btw from the Microsoft documentation (I'm trying to understand this one also if harder) I assumed two informations:
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms.dll
So as what I learned, I tried those steps:
1) add
2) add a COM reference to System.Windows.Forms
I don't know if I thought in the right way, but this seems not working.
The ideal result is the following, by cmd:
-base64.exe -e string (for encrypt)-base64.exe -d string (for decrypt)
What I'm unable to do, and that I always did in VB.NET Winforms, is Clipboard.SetText and I'm surprised to know that's strictly related to WinForms, since we're not talking abuot a button, or a textbox, but about the clipboard, that's global and abstract.
Btw from the Microsoft documentation (I'm trying to understand this one also if harder) I assumed two informations:
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms.dll
So as what I learned, I tried those steps:
1) add
2) add a COM reference to System.Windows.Forms
I don't know if I thought in the right way, but this seems not working.


