First record a irrelevant title ~
Just learning to use C #, when programming with VS for graphical interfaces, add space to the point interface, and the control's property page appears on the right side of the VS interface, but this property page is not full,
Only some of the important properties are listed, at first it was thought that there is no corresponding property method, and then went to Baidu found this attribute, but not every time Baidu so troublesome it,
Ask a colleague and know that there are two ways to see all the properties of a control:
One is to enter the name of the control when editing in VS and., the list that comes out is all attributes;
Another is to view MSDN, enter the name of the control, and view the members.
————————————————————————————————————————————————————————————
The requirement is this: Enter the parameters in the C # tool, click on the button, call bat and pass the parameters just entered into the bat to execute.
It was considered whether it was necessary to manually set the bat to the active window after calling up the bat, and then send the parameters, but later found a bit of trouble,
Need FindWindow, Setforeground and so on, try to do not succeed so give up. Thought for a moment,
Generally pull out the bat after not move, should focus on the bat. Just need:
1 Process.Start (a.txt); 2 sendkeys.sendwait (PAR1); 3 sendkeys.sendwait ({ENTER}");
Try it out in VS and it works.
But there is a small problem, when you double-click the compiled EXE, the card in the bat interface does not have input parameters, why?
Guess, when the external environment is running, the active window is not bat when the parameter is entered, and the pass is a bit slow.
Try adding a sentence between lines 1 and 2:
Thread.Sleep (+);
After compiling, double-click EXE, successful, can normally input parameters to bat.
One problem occurred several times, not resolved, recorded: For example, to bat input 0, there may be two 0~
C # Enter characters into a batch file