Paste into a Textbox on webpage

Macs Bank

Client
Регистрация
25.04.2014
Сообщения
59
Благодарностей
3
Баллы
8
Anyone know how to emulate a paste command inside a specific textbox of a webpage.

The website doesn't allow you to manually type and submit the data... it requires the act of pasting.

I've tried playing around with c# using something like this:

System.Windows.Forms.SendKeys.SendWait("^v");

... but, it doesn't appear to be working. Also, I am not sure how to set the value of what needs to be pasted. I have a list of things I want to loop through and paste...

Hopefully this makes sense and someone has a solution.

thanks.
 

Mikhail B.

Client
Регистрация
23.12.2014
Сообщения
14 415
Благодарностей
5 454
Баллы
113

Macs Bank

Client
Регистрация
25.04.2014
Сообщения
59
Благодарностей
3
Баллы
8
thank you!! that worked!
 
  • Спасибо
Реакции: Mikhail B.

Macs Bank

Client
Регистрация
25.04.2014
Сообщения
59
Благодарностей
3
Баллы
8
One more question about this...

Any idea how to make it work more efficiently when using multiple threads.
Is there a way to make each thread wait until the other one finishes the c# process before it does the same process?

Just want to make sure the right things are getting pasted into the right place if using multiple threads with different text.

hopefully this makes sense...

Here's the code I'm using:

Код:
string text = project.Variables["paste_this"].Value;
System.Windows.Forms.Clipboard.SetText(text);
instance.ActiveTab.KeyEvent("v","press","ctrl");
thanks in advance!
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
C#:
string text = project.Variables["paste_this"].Value;
lock(SyncObjects.InputSyncer)
{
    System.Windows.Forms.Clipboard.SetText(text);
    instance.ActiveTab.KeyEvent("v","press","ctrl");
}
 
  • Спасибо
Реакции: Macs Bank

Macs Bank

Client
Регистрация
25.04.2014
Сообщения
59
Благодарностей
3
Баллы
8

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)