程序代码:
On Error xlsrs=Createobject('Excel.application') xlsrs=Getobject(,'Excel.application') *On Error xlsrs.Visible=.T. _fnm=ADDBS(JUSTPATH(SYS(16,1))) SET DEFAULT TO (_fnm) _fnm=ADDBS(JUSTPATH(SYS(16,1)))+'表.xls' xlsrs.Workbooks.Open(_fnm) _rows=xlsrs.sheets(1).UsedRange.Rows.Count&&有数据的总行数 CLOSE TABLES all CREATE table jmwj (sfl c(40),tfl c(40) ,pswd c(32)) FOR i=2 TO _rows APPEND BLANK REPLACE sfl WITH Alltrim(xlsrs.cells(i,1).Value),tfl WITH Alltrim(xlsrs.cells(i,2).Value),pswd WITH Alltrim(xlsrs.cells(i,3).Value) ENDFOR xlsrs.Workbooks.Close() xlsrs.quit Release xlsrs IF FILE("C:\Program Files\WinRAR\Rar.exe") cmdstr='"C:\Program Files\WinRAR\Rar.exe" a -hp' ELSE IF FILE("C:\ProgramFiles(x86)\WinRAR\Rar.exe") cmdstr='"C:\ProgramFiles(x86)\WinRAR\Rar.exe " a -hp' ELSE =MESSAGEBOX("未找到RAR程序") ENDIF ENDIF **将-hp 改为 -p 可不用密码看到压缩包中的文件名 SCAN dbnm=JUSTSTEM(sfl)+'.dbf' tnm=' '+JUSTSTEM(tfl)+'.rar ' pwd=ALLTRIM(pswd) cmd=cmdstr+pwd+tnm+dbnm RUN /n7 &cmd. ENDSCAN
dBase有人接盘了。