精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● VFP>>〖编程技巧〗>>Re:如何获得VFP编译后的程序的版本号?

主题:Re:如何获得VFP编译后的程序的版本号?
发信人: pig2609()
整理人: hunter__fox(2002-03-16 23:13:41), 站内信件
*- 下面是我个loader.exe的一部分, 那个函数 6.0 7.0都是有的
 
FUNCTION pvWorking
local  cProdName,aFile(1),aFileInfo(1),cFile,nVer,cTmp

cProdName=upper(allt(gcGetINIStr(gcINI文件名,'Loader','ProductName') ))
cPath=allt(gcGetINIStr(gcINI文件名,'Loader','Path') )
if empty(cPath)
cPath='.'
Endif
cPath=addbs(cPath)
if not directory(cPath)
messagebox("Path not found",16,'LOADER',1000*10)
return
endif

CREATE CURSOR csExe ( FileName c(100),Version i,ModifyDate d,ModifyTime c(10) )
For i=1 to Adir(aFile,cPath+'*.exe')
cFile=aFile(i,1)
AGetFileVersion(aFileInfo,cPath+cFile)
If not cProdName==allt(upper(aFileInfo(10))) &&product name
loop
endif

nVer=10^8+val( getwordnum(aFileInfo(4),1,'.') )+ ;
  10^4+val( getwordnum(aFileInfo(4),2,'.') )+ ;
 val( getwordnum(aFileInfo(4),3,'.') )
append blank
replace filename with aFile(i,1),;
  version with nVer,;
  ModifyDate with aFile(i,3),;
  ModifyTime with aFile(i,4)
Next 

select * ;
from csExe ;
order by version desc ,ModifyDate desc,ModifyTime desc,fileName desc;
into cursor csTmp

if _tally=0
messagebox("There isn't any executable files that have a matched internal product name",;
16,'LOADER of Yxsoft',1000*10)
RETURN
ENDIF

cTmp="run /n1 "+cPath+allt(filename)
SET DEFAULT TO (cPath)
ExecScript(cTmp)

RETURN





----
max chen
senior programer 
[email protected]
QQ:65004737

[关闭][返回]