process.start&填写申请表 [英] process.start & fill app form
问题描述
启动应用程序进程然后填写表单字段的首选方法是什么?
以下编程无法编译(b / c AppActivate没有
正确的参数):
-------------------------------------- --------------------------------------------------
进口Microsoft.VisualBasic
进口System.Windows.Forms
进口System.Diagnostics
模块模块1
Sub Main()
Dim proc As Process = Process.Start(" c:\ app2020 \app.EXE")
AppActivate(proc)
SendKeys.SendWait(" 22")
End Sub
结束模块
What is preferred method to start an app process and then fill in form fields?
The following prog does not compile (b/c AppActivate does not have the
correct param):
----------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics
Module Module1
Sub Main()
Dim proc As Process = Process.Start("c:\app2020\app.EXE")
AppActivate(proc)
SendKeys.SendWait("22")
End Sub
End Module
推荐答案
我怀疑应用程序(app.exe)有时间在你尝试
并激活它时开始。在激活之前尝试延迟几秒钟。
" ep。" < ep@discussions.microsoft.com写信息
新闻:5A **************************** ****** @ microsof t.com ...
I doubt the application (app.exe) has had time to start by the time you try
and activate it. Try a delay of a few seconds before activating it.
"ep." <ep@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
什么是启动应用程序流程然后填写表格的首选方法
字段?
以下编程无法编译(b / c AppActivate没有
正确的参数):
--- -------------------------------------------------- -----------------------------------
进口Microsoft.VisualBasic >
Imports System.Windows.Forms
Imports System.Diagnostics
模块模块1
Sub Main()
Dim proc As Process = Process.Start(" c:\ app2020 \app.EXE")
AppActivate(proc)
SendKeys.SendWait(" 22")
End Sub
结束模块
What is preferred method to start an app process and then fill in form
fields?
The following prog does not compile (b/c AppActivate does not have the
correct param):
----------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics
Module Module1
Sub Main()
Dim proc As Process = Process.Start("c:\app2020\app.EXE")
AppActivate(proc)
SendKeys.SendWait("22")
End Sub
End Module
对不起,而且proc.Id应该传递给AppActivate。
Family Tree Mik E" < Fa ************ @ ThisOldHouse.com写在留言中
新闻:%2 **************** @ TK2MSFTNGP05.phx.gbl ...
Sorry, but also the proc.Id should be passed to the AppActivate.
"Family Tree Mike" <Fa************@ThisOldHouse.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>我怀疑应用程序(app.exe)在您尝试时已经有时间启动了
激活它。在激活之前尝试延迟几秒钟。
" ep。" < ep@discussions.microsoft.com写信息
新闻:5A **************************** ****** @ microsof t.com ...
>I doubt the application (app.exe) has had time to start by the time you try
and activate it. Try a delay of a few seconds before activating it.
"ep." <ep@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
>启动应用程序流程然后填写表格的首选方法是什么?
字段?
以下编程无法编译(b / c AppActivate没有
正确的参数):
----------------- -------------------------------------------------- ---------------------
进口Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics >模块模块1
Sub Main()
Dim proc As Process = Process.Start(" c:\ app2020 \app.EXE")
AppActivate(proc)
SendKeys.SendWait(" 22")
End Sub
End Module
>What is preferred method to start an app process and then fill in form
fields?
The following prog does not compile (b/c AppActivate does not have the
correct param):
----------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics
Module Module1
Sub Main()
Dim proc As Process = Process.Start("c:\app2020\app.EXE")
AppActivate(proc)
SendKeys.SendWait("22")
End Sub
End Module
8月24,4:12 am,ep。 < e ... @ discussion.microsoft.comwrote:
On Aug 24, 4:12 am, ep. <e...@discussions.microsoft.comwrote:
启动应用程序流程然后填写表单字段的首选方法是什么?
以下编程无法编译(b / c AppActivate没有
正确的参数):
------------ -------------------------------------------------- --------------------------
进口Microsoft.VisualBasic
Imports System.Windows .Forms
Imports System.Diagnostics
模块模块1
Sub Main()
Dim proc As Process = Process.Start(" c:\ app2020 \app.EXE")
AppActivate(proc)
SendKeys.SendWait(" 22")
结束子
结束模块
What is preferred method to start an app process and then fill in form fields?
The following prog does not compile (b/c AppActivate does not have the
correct param):
----------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics
Module Module1
Sub Main()
Dim proc As Process = Process.Start("c:\app2020\app.EXE")
AppActivate(proc)
SendKeys.SendWait("22")
End Sub
End Module
要使AppActivate正常工作,你应该传递processID(整数)或
标题(字符串)作为参数,请参阅MSDN上的记事本示例:
http://msdn.microsoft.com/en-us/libr...hy(VS.80).aspx
我会一见钟情地使用该代码,但我相信它会导致
因为某种时序错误而没有找到ProcessID异常:
' '你可以使用Process.Start
进口Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics
模块模块1
Sub Main()
Dim ProcessID As Integer
ProcessID = Process.Start(" c :\ app2020 \app.EXE")。Id
AppActivate(ProcessID)
SendKeys.SendWait(" 22")
结束子
结束模块
因此,请使用演示
WinForm应用程序的计时器控件来坚持以下内容:
''----开始--------
''注意在运行app set timer'的时间间隔之前
''合理的间隔时间为1500毫秒
''或更少或更多如你所愿在IDE中使用。
Imports System.diagnostics
Public Class Form1
Dim ProcessID作为整数
Sub RunProcess()
ProcessID = Process.Start(" c:\ app2020 \ app.EXE")。Id
End Sub
''例如:在button_click事件上调用sub
Private Sub Button1_Click(ByVal sender As System.Object,_
ByVal e As System.EventArgs)处理Button1.Click
RunProcess()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object,_
ByVal e As System.EventArgs)处理Timer1.Tick
''现在调用AppActivate
AppActivate(ProcessID)
SendKeys.SendWait(" 22")
Timer1.Enabled = False
结束次级
结束班级
''----结束-------
希望这会有所帮助,
OnurGüzel
To make AppActivate work, you should pass processID(Integer) or
Title(String) as parameter, see notepad sample on MSDN:
http://msdn.microsoft.com/en-us/libr...hy(VS.80).aspx
I would use that code at first sight, but i beleive it causes
ProcessID not found exception because of a kind of timing error:
'' You can use Process.Start
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Diagnostics
Module Module1
Sub Main()
Dim ProcessID As Integer
ProcessID = Process.Start("c:\app2020\app.EXE").Id
AppActivate(ProcessID)
SendKeys.SendWait("22")
End Sub
End Module
So, stick with the following using a timer control that demonstrates a
WinForm app:
'' ----Begin--------
'' Note that before running app set timer''s interval
'' to a reasonable interval ike 1500 miliseconds
'' or less or more as you wish in IDE.
Imports System.diagnostics
Public Class Form1
Dim ProcessID As Integer
Sub RunProcess()
ProcessID = Process.Start("c:\app2020\app.EXE").Id
End Sub
''Eg: Call sub on a button_click event
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
RunProcess()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
''Now call AppActivate
AppActivate(ProcessID)
SendKeys.SendWait("22")
Timer1.Enabled = False
End Sub
End Class
''----End-------
Hope this helps,
Onur Güzel
这篇关于process.start&填写申请表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!