gpt4 book ai didi

command-line - 如何从 PGP 命令行代码中获取返回码

转载 作者:行者123 更新时间:2023-12-04 04:00:42 26 4
gpt4 key购买 nike

我正在使用 McAfee E-Business Server v8.6,我想从命令行的加密/解密命令中获取返回码。我从 PowerBuilder 运行上述代码。我想从配置中设置的日志文件中获取返回码。有人知道该怎么做吗?谢谢。

最佳答案

我不确定 PGP 特别是,但如果这些是在本地运行的,这就是我运行外部命令并获取返回码的方式:

外部函数原型(prototype)

FUNCTION boolean CreateProcess(string AppName, string CommLine, long l1, long l2, boolean binh, long creationflags, long l3, string dir, str_startupinfo startupinfo, ref str_processinformation pi ) library 'kernel32.dll' alias for "CreateProcessW"
FUNCTION long WaitForSingleObject ( ulong ul_Notification, long lmillisecs ) library "kernel32.dll"
FUNCTION long GetExitCodeProcess(ulong hProcess,ref ulong lpExitCode) LIBRARY "kernel32.dll"
FUNCTION boolean CloseHandle(ulong h) library 'kernel32.dll'

function of_runandwait (string as_command, boolean ab_Visible) 返回 ulong
constant long STARTF_USESHOWWINDOW = 1
constant long CREATE_NEW_CONSOLE = 16
constant long NORMAL_PRIORITY_CLASS = 32
constant long INFINITE = -1
boolean lb_Return
long ll_Null, ll_CreationFlags, ll_Return
ulong lul_ProcessReturn
string ls_CurDir, ls_Null
str_StartupInfo lstr_Start
str_Processinformation lstr_PI

SetNull(ll_Null)
SetNull(ls_Null)
SetNull(ls_CurDir)

lstr_Start.cb = 72
lstr_Start.dwFlags = STARTF_USESHOWWINDOW
IF ab_Visible THEN
lstr_Start.wShowWindow = 1
ELSE
lstr_Start.wShowWindow = 0
END IF

ll_CreationFlags = CREATE_NEW_CONSOLE + NORMAL_PRIORITY_CLASS

lb_Return = CreateProcess (ls_Null, as_Command, ll_Null, ll_Null, FALSE, ll_CreationFlags, ll_Null, ls_CurDir, lstr_Start, lstr_PI)
ll_Return = WaitForSingleObject (lstr_PI.hProcess, INFINITE)
ll_Return = GetExitCodeProcess (lstr_PI.hProcess, lul_ProcessReturn)
CloseHandle(lstr_PI.hProcess)
CloseHandle(lstr_PI.hThread)

RETURN lul_ProcessReturn

希望这可以帮助。

祝你好运,

特里。

关于command-line - 如何从 PGP 命令行代码中获取返回码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5854982/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com