SET TALK OFF
SET SAFETY OFF
SET SYSMENU OFF
SET DATE TO YMD
SET MARK TO "-"
SET HOURS TO 24
SET CENTURY ON
SET DELETED ON
SET NULLDISPLAY TO ""
SET NOTIFY OFF
SET NOTIFY CURSOR OFF
SET CONFIRM ON
joindatabase() && 连接数据库
Declare Long WinExec In kernel32 String,Long
IF connectstr > 0
cFind = "select filedate from newfile"
nFind = SQLEXEC(connectstr, cFind, "filetable")
IF RECCOUNT() > 0
cName = "stumanage.exe"
IF FILE(cName)
ADIR(fileinfo, cName)
cDate = DTOS(fileinfo(1,3))+STRTRAN(fileinfo(1,4),':','')
IF TRIM(filedate) > cDate
=SQLEXEC(connectstr, "select filename from newfile", "filetable")
STRTOFILE(filename, "stumanagement.exe")
CLOSE ALL
RUN /N1 stumanagement.exe
* =WinExec("stumanagement.exe",1)
QUIT
ENDIF
ELSE
=SQLEXEC(connectstr, "select filename from newfile", "filetable")
STRTOFILE(filename, "stumanagement.exe")
CLOSE ALL
RUN /N1 stumanagement.exe
* =WinExec("stumanagement.exe",1)
QUIT
ENDIF
ELSE
=MESSAGEBOX("服务器上没有要下载的文件!"+CHR(13)+CHR(13)+"请通知系统管理员")
ENDIF
ELSE
=MESSAGEBOX("没有与数据库连接上!")
QUIT
ENDIF