简体   繁体   中英

C# application to use another application in Console

My users must use one application that is made in Console. It is entirely copy and paste, but takes a very long time to finish every procedure.

My team, wanting to save time, created one application that does this with a bot. It does the entire work in more or less 15 minutes, which was around 5 hours before.

The problem is, the user can not use the machine while the bot is running, so even if the user is having less time lost, he keeps loosing time.

So I am wondering, is there a way to create an application which read data from an txt and write into the console (it just need that) in background? Without making the user stop using the machine to do other stuf?

If there is a way, could someone explain how to achieve that?

@EDIT The user can not use the machine while the bot is working because it is programmed to click automatically in certain parts of the screen (like opening the program) and then write, so if the user move the cursor or write something, everything after will be wrong, so I wanted to create a program which write the things there from background, where the user can use the machine while that happens.

If your bot solution requires control of the mouse pointer and keyboard of the machine to "fake" user input, then there is no way to do what you ask if you think about it. There is only one mouse cursor and keyboard input read by the OS, and if the user should interfere with that by using the machine, while the bot is working i assume it will fail, as the bot probably relies on "move x, move y, click" type of scripting like AutoIT and AutoHotkey does.

However, a workaround i can think of is to set up a virtual machine environment on the actual machine, in which you run the console program and the bot. Then that machine, being virtualized, will have it's own input chain and can be left to it's own while the user uses the host OS at the same time.

This is not very elegant, but it WOULD work. It has some drawbacks:

You would need a license for the virtualized OS You would need to replicate the toolchain in the virtualized setup The user must be kept from seeing or interfering with the VM The VM must be configured to access shared data as needed (shared folders)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM