📄 9933.html
字号:
<html>
<head>
<title>Re: 请问关于shell问题</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 请问关于shell问题</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by Someone on February 08, 1999 at 08:21:33:<p>
In Reply to: <a href="9922.html">请问关于shell问题</a> posted by kit on February 07, 1999 at 18:31:56:<p>
: 请问如何可以得到,在用shell开启之程式(dos下的执行档)输出的文字<br>: 谢谢<br>Re : <br>我有一个笨方法,仅供参考,我是将输出转成一个文字档,首先宣告<br>Private Declare Function OpenProcess Lib "kernel32" _<br> (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _<br> ByVal dwProcessId As Long) As Long<br>Private Declare Function GetExitCodeProcess Lib "kernel32" _<br> (ByVal hProcess As Long, lpExitCode As Long) As Long<br>Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long<br> Dim ShellID, ExitCode, hProcess As Long<br> Const PROCESS_QUERY_INFORMATION = &H400<br> Const STILL_ALIVE = &H103<br>'以上请参考cww网站上Shell相关详细说明<br>在事件中利用ShellID =Shell("command.com /c 加执行档后面再加>Output.txt,vbHide) '将它转到Output文字档<br>'然后呼叫API判断是否此程序已完毕<br>hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0, ShellID)<br> Do<br> Call GetExitCodeProcess(hProcess, ExitCode) <br> Loop While ExitCode = STILL_ALIVE<br> Call CloseHandle(hProcess)<br> Open "Output.txt" For Input As #1<br> While Not EOF(1)<br> Line Input #1, OutputLine<br>.....<br>'后面就是开档的动作,应该会吧!<br>我再想一定有其他办法,也麻烦各位高手赐教顺便教教小弟 :)
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 9933-->
</ul><!--end: 9933-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -