我希望能够在另一项申请中采取以下行动:
- to change Tabs
- to Copy text from within a TextBox
- to click on a Button
- to enter text into a TextBox
- to select DropDownList element
我现在使用不同的方法,例如:
- mouse_event() to change mouse coordinates and click on a button
- another mouse_event(LeftMouseClick followed by the RightMouseClick) to copy a text within a TextBox
- Clipboard.GetText(System.Windows.Forms.TextDataFormat.Text) to Copy what s inside the clipboard
- SendInput (for each key) - enter the text into a TextBox
这种办法的缺点是:
- (not crucial) PC becomes unusable (you can t work while script is running)
- I have to know exact pixels (read - position/coordinates) of EVERY element within an app
- slow execution time (each key has to be typed separately)
我期待创建一个应用程序,可以点击文本框/按钮/列表 ,而不需要这些元素的精确坐标 。
Is such task possible with C# WinForms? My current approach works but it has it s flaws. Any advice?