52 Replies
I want to make code that will auto paste link into google
Ok but like from what?
A google extension?
Why do you need this?
If you want to open a website you can just do that through
Processi know
Then why not use that?
i need
to copy and paste certian code
for a web page
@thinker227
wat
Describe in words what you are trying to do.
input automation, like a password manager?
using System;
using System.Windows.Forms;
using TextCopy;
class Program
{
static void Main(string[] args)
{
string textToCopy = "Hello, world!";
// Copy the text to clipboard
Clipboard.SetText(textToCopy);
// Wait for a moment to ensure clipboard has the text
System.Threading.Thread.Sleep(100);
// Use SendKeys to send Ctrl+V to paste the text
SendKeys.Send("^v");
// Clear the clipboard
Clipboard.Clear();
}
}
@thinker227what does this have to do with opening websites
bruh
can you just help me
What are you trying to do?
Are you trying to open a website from code?
ye
just help me
One second.
please
ye
i did this already
now i need to paste text
like open youtube
and
just SEARCH
for rickroll
or something
wat
Paste text?
ye
copy text from clipboard
and paste itr
paste it where
dont know
so you don't know what you're trying to do
like in notepad
ok
open notepad
paste text
from clipboard
nothing else

code + errors
what's wrong
there?
Clipboard does not contain a definition for Clear
so how do i clear the clipboard?
What library are you using
?
wdym
TextCopy?i dont know
GitHub
GitHub - CopyText/TextCopy: A cross platform package to copy text t...
A cross platform package to copy text to and from the clipboard. - GitHub - CopyText/TextCopy: A cross platform package to copy text to and from the clipboard.
ye
but it dont recognize the clipboard

i fixed few errors
2 more to go
If you read the documentation of the library, you'll see that you should use
ClipboardService.SetText instead of Clipboard.SetTextlool
And I'd guess that "clearing" the clipboard would amount to
ClipboardService.SetText("");fixed
thank you
can i ping you when i ran to new problem?
no
k
bye
Also instead of that
Thread.Sleep you should really be using await ClipboardService.SetTextAsync(yourText); which waits for the text to be setshould i?
yes, yes you probably should
yo and if i have 2 .cs codes
when i ran it, will it start both of them?
It will run the method called
Main, or the file containing top-level codewtf, is this
Dude you're not a very good helpee
Also if you're hacking some opening a page and copy pasting crap just use selenium or something
Was this issue resolved? If so, run
/close - otherwise I will mark this as stale and this post will be archived until there is new activity.