给你个列子:
调用部分如下:
path:=extractfilepath(application.ExeName)+'project_query.exe' + ' ';
scmd := path + '<ICCARD>' + icno + '</ICCARD>' +
'<SERVERNAME>' + FieldByName('ServerIP').AsString + '</SERVERNAME>' +
'<DBNAME>' + FieldByName('DBName').AsString + '</DBNAME>' +
'<LOGINNAME>' + FieldByName('LoginName').AsString + '</LOGINNAME>' +
'<LOGINPSW>' + FieldByName('LoginPsw').AsString + '</LOGINPSW>' +
'<TABLENAME>' + sTableName + '</TABLENAME>';
winexec(pchar(scmd),sw_shownormal)
被调用部分:
if paramcount <= 0 then
begin
Close;
Exit;
end;
sParm := paramstr(1);
GIcCardNo := FirstSubStr(sParm,'<ICCARD>','</ICCARD>');
sServer := FirstSubStr(sParm,'<SERVERNAME>','</SERVERNAME>');
sDbm := FirstSubStr(sParm,'<DBNAME>','</DBNAME>');
sUser := FirstSubStr(sParm,'<LOGINNAME>','</LOGINNAME>');
sPsw := FirstSubStr(sParm,'<LOGINPSW>','</LOGINPSW>');
其中FirstSubStr函数是取中间值,如:两个<ICCARD>之间的值。这个函数是自己写的。