2011-05-02 132 views
3

我正在使用McAfee E-Business Server v8.6,我想從命令行獲取加密/解密命令的返回碼。我從PowerBuilder運行上述代碼。我想從配置中設置的日誌文件中獲取返回碼。會有人知道如何做到這一點?謝謝。如何從PGP獲取返回代碼命令行代碼

回答

1

我不知道PGP特別,但如果這些正在本地運行,這是我運行一個外部命令,得到返回代碼:

ExternalFunctionPrototypes

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' 

功能of_runandwait(串as_command,布爾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 

希望這有助於。

祝你好運,

特里。