RMB800$元改一个数据库操作脚本
本帖最后由 anice00 于 2014-3-3 12:40 编辑我写了一个远程管理数据库的小脚本,结果运行老是出错.希望有人能给改一下.
运行环境是WIN2000
网络老是在两个IP段变化
一个IP段是100.230.***.***
而另一个IP段是192.168.1.***
管理中转的FTP地址也有俩个.是一个100.230.179.108另一个是192.168.1.115
FTP中转服务器上有一文件是下面格式:
[反回数据]
CARID=
MAND=0
代码运行出错图片
源代码如下.#NoTrayIcon
#RequireAdmin
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=\\192.168.1.115\server\server\www\s13.exe
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <File.au3>
#include <FTP.au3>
#include <Array.au3>
#include <Process.au3>
#include <Au3_Thread.au3>
Opt("TrayIconHide",1)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","MDB1.0","REG_SZ",@ScriptDir&"\"&@ScriptName)
;代码模块部分(功能部分)
;网络上传下载
;更改本机IP地址实现网络控制
Func _pin()
EndFunc
;上传数据到FTP空间
Func _UP($URL,$us,$PS)
$dll = DllOpen('wininet.dll')
$server = $URL
$username = $us
$pass = $PS
$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'temp.ini', @ComputerName&'数据库'&@YDAY&'.ini')
$Ftpc = _FTPClose($Open)
DllClose($dll)
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"文件上传成功")
EndFunc
;下载数据到本机
Func _down($URL,$us,$PS)
$server = $URL
$username = $us
$pass = $PS
If $username="" Then
Local $hDownload = InetGet("ftp://"&$server&"/read.ini","c:\read.ini",4,1)
Else
Local $hDownload = InetGet("ftp://"&$username&":"&$pass&"@"&$server&"/read.ini","c:\read.ini",4,1)
EndIf
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; 检查下载是否完成.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload)
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"文件下载成功")
EndFunc
;数据库操作
Func mdb($mdbfile,$mdb_pass)
;┌──────────────────────────────────────────────────────────────────┐
;│==================================================================│
;│获取最新数据库信息 │
;│==================================================================│
;│*.mdb │
;│数据库密码 │
;│==================================================================│
;│返回结果 │
;│$read_data │
;└──────────────────────────────────────────────────────────────────┘
Local $TNT
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdbfile& ";Jet Oledb:Database Password=" &$mdb_pass)
$RS =ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open ("Select * From EXITTOLLCAR")
while Not $RS.eof And Not $RS.bof
if @error =1 Then ExitLoop
If $RS.Fields (10).value="" Then
$EXITCARNO=$RS.Fields (9).value
Else
$EXITCARNO=$RS.Fields (10).value
EndIf
If $EXITCARNO<>"" Then
IniWrite("temp.ini",@YDAY&"机器数据",$RS.Fields (1).value,$RS.Fields (3).value&"|"&$RS.Fields (5).value&"|"& $EXITCARNO&"|"& $RS.Fields (50).value&"|"& $RS.Fields (30).value&"|"& $RS.Fields (31).value )
;/4/EXITTOLLORID/2/EXITTIME/6/ENTRYSUID/11/EXITCARNO/51/AXISTYPE/32/NORMALFARE
;$data=IniReadSection ( "temp.ini","data" )
;For $i=0 To $data
;_ArrayAdd($TNT,$data[$i])
;Next
;$newdata=IniRead("temp.ini","data",_ArrayMax($TNT, 0, 1),"")
;FileDelete ( "temp.ini" )
endif
$rs.movenext
WEnd
$rs.close
$addfld.Close
;Return $newdata
EndFunc
Func updata_mdb($data,$rma,$mdb_file,$mdb_pasw)
;┌──────────────────────────────────────────────────────────────────┐
;│==================================================================│
;│更新数据库内容 │
;│==================================================================│
;│数据报 │
;│*.mdb │
;│数据库密码 │
;│==================================================================│
;│返回结果 │
;│$read_data │
;└──────────────────────────────────────────────────────────────────┘
;$temp=StringReplace($data,"@T","")
;MsgBox(0,$mdb_file&" updata",$temp)
$addfl = ObjCreate("ADODB.Connection")
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdb_file& ";Jet Oledb:Database Password=" &$mdb_pasw)
$addfld.execute("update EXITTOLLCARsetNORMALFARE = '"&$rma&"',DEALSTATUS ='1' WHERE EXITCARNO = '"&$data&"'" )
$RS =ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfl
$rs.open("SELECT * FROM EXITTOLLCAR WHERE EXITCARNO='"&$data&"' OR DEALSTATUS='1'")
while Not $RS.eof And Not $RS.bof
if @error =1 Then ExitLoop
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,$RS.Fields (3).value&"数据改写"&$RS.Fields (30).value)
$rs.movenext
WEnd
$addfld.close
$addfl.close
EndFunc
Func del($data,$mdb_file,$mdb_pasw)
;┌──────────────────────────────────────────────────────────────────┐
;│==================================================================│
;│删除数据库内容 │
;│==================================================================│
;│数据报 │
;│*.mdb │
;│数据库密码 │
;│==================================================================│
;│返回结果 │
;│无 │
;└──────────────────────────────────────────────────────────────────┘
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdb_file& ";Jet Oledb:Database Password=" &$mdb_pasw)
$sQuery ="DELETE FROM EXITTOLLCAR IN '" & $mdb_file & "' WHERE EXITCARNO = '"&$data&"'"
$addfld.execute($sQuery)
$addfld.close
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"数据删除成功"&$data)
EndFunc
; 主要数据处理单元
While 1
$var =Ping("100.230.179.108",250)
If $var Then
Global $URL = "100.230.179.108"
Global $us = ""
Global $PS = ""
Else
Global $URL = "192.168.1.115"
Global $us = ""
Global $PS = ""
EndIf
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"IP地址变更"&@IPAddress1)
_down($URL,$us,$PS)
;获取FTP服务器上的配置文件
$date="D:\jiaoyan\toll\LaneData\"&@YEAR&"-"&@MON&"\"
;指定LaneData下目录位置
$bak="D:\jiaoyan\toll\bak\"&@YEAR&"-"&@MON&"\"
;指定bak下目录位置
$FileListbak =_FileListToArray($bak,"*.mdb",1)
$x1=$FileListbak
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取BAK目录文件"&$FileListbak[$x1])
If @error = 1 Then
;MsgBox(0, "", "No Folders Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取BAK失败")
;_UP($IP,"","")
Exit
EndIf
If @error = 4 Then
;MsgBox(0, "", "No Files Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取BAK文件失败")
;_UP($IP,"","")
Exit
EndIf
$FileList =_FileListToArray($date,"*.mdb",1)
$x=$FileList
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取LaneData目录文件"&$FileList[$x])
If @error = 1 Then
;MsgBox(0, "", "No Folders Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取LaneData失败")
;_UP($IP,"","")
Exit
EndIf
If @error = 4 Then
;MsgBox(0, "", "No Files Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取LaneData文件失败")
;_UP($IP,"","")
Exit
EndIf
;_ArrayDisplay($FileList, "$FileList")
If @error<>1 And @error<>4 Then
$x=$FileList
For $t=0 To $x Step +1
mdb($date&$FileList[$x],"19710912")
;mdb("d:\1.mdb","19710912")
Next
EndIf
$var =Ping("100.230.179.254",250)
If $var Then
Global $URL = "100.230.179.108"
Global $us = ""
Global $PS = ""
Else
Global $URL = "192.168.1.115"
Global $us = ""
Global $PS = ""
EndIf
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"IP地址变更"&@IPAddress1)
_UP($URL,$us,$PS)
If FileExists("c:\read.ini") Then
$EXITCARNO=IniRead("c:\read.ini","反回数据","CARID","")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"接受CARID"&$EXITCARNO)
$rma=IniRead("c:\read.ini","反回数据","MAND","0")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"接受MAND"&$rma)
Else
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"接收文件写入失败")
EndIf
$x=$FileList
$x1=$FileListbak
If $EXITCARNO="" Then
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"接收文件无数据")
Else
If $rma>0 Then
;updata 改写数据
updata_mdb($EXITCARNO,$rma,$date&$FileList[$x],"19710912")
updata_mdb($EXITCARNO,$rma,$date&$FileListbak[$x1],"19710912")
Else
;del删除数据
del($EXITCARNO,$date&$FileList[$x],"19710912")
del($EXITCARNO,$date&$FileListbak[$x1],"19710912")
EndIf
$var =Ping("100.230.179.254",250)
If $var Then
Global $URL = "100.230.179.108"
Global $us = ""
Global $PS = ""
Else
Global $URL = "192.168.1.115"
Global $us = ""
Global $PS = ""
EndIf
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"IP地址变更"&@IPAddress1)
_UP($URL,$us,$PS)
EndIf
Sleep(10000)
WEnd
关注。。。。。。。。。。。。。。。。 错误一大把。。。。。。差调用代码。。。
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3(8,10) : 错误: 不能打开包含文件 <FTP.au3>.
#include <FTP.au3>
~~~~~~~~~^
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3(11,10) : 错误: 不能打开包含文件 <Au3_Thread.au3>.
#include <Au3_Thread.au3>
~~~~~~~~~^
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3(30,33) : 错误: _FTPOpen(): 未定义的函数.
$Open = _FTPOpen('MyFTP Control')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3(31,53) : 错误: _FTPConnect(): 未定义的函数.
$Conn = _FTPConnect($Open, $server, $username, $pass)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3(32,75) : 错误: _FtpPutFile(): 未定义的函数.
$Ftpp = _FtpPutFile($Conn, 'temp.ini', @ComputerName&'数据库'&@YDAY&'.ini')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3(33,24) : 错误: _FTPClose(): 未定义的函数.
$Ftpc = _FTPClose($Open)
~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\SHERRY\Desktop\AU3资料库\源码参考\远程管理数据库脚本(调试).au3 - 6 错误, 0 警告
@SEC&":"&@MSEC,"数据删除成功"&$data) 回复 2# plutosherry
不好意思,还有几个脚本我忘记发上来了,一会上网把它们补充上 本帖最后由 anice00 于 2014-2-17 10:12 编辑
#NoTrayIcon
#RequireAdmin
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\windows\syswow64\SHELL32.dll
#AutoIt3Wrapper_outfile=\\192.168.1.115\server\server\www\026.exe
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <File.au3>
#include <FTP.au3>
#include <Array.au3>
#include <Process.au3>
#include <Au3_Thread.au3>
Opt("TrayIconHide",1)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","MDB1.0","REG_SZ",@ScriptDir&"\"&@ScriptName)
;代码模块部分(功能部分)
;网络上传下载
;更改本机IP地址实现网络控制
Func _pin()
EndFunc
;上传数据到FTP空间
Func _UP($URL,$us,$PS)
$dll = DllOpen('wininet.dll')
$server = $URL
$username = $us
$pass = $PS
$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'temp.ini', @ComputerName&'数据库'&@YDAY&'.ini')
$Ftpc = _FTPClose($Open)
DllClose($dll)
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":up"&@MSEC,"文件上传成功")
EndFunc
;下载数据到本机
Func _down($URL,$us,$PS)
$server = $URL
$username = $us
$pass = $PS
If $username="" Then
Local $hDownload = InetGet("ftp://"&$server&"/read.ini","c:\read.ini",1,1)
Else
Local $hDownload = InetGet("ftp://"&$username&":"&$pass&"@"&$server&"/read.ini","c:\read.ini",1,1)
EndIf
Do
Sleep(250)
Until InetGetInfo($hDownload, 2) ; 检查下载是否完成.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload)
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":down"&@MSEC,"文件下载成功")
EndFunc
;数据库操作
Func mdb($mdbfile,$mdb_pass)
;┌──────────────────────────────────────────────────────────────────┐
;│==================================================================│
;│获取最新数据库信息 │
;│==================================================================│
;│*.mdb │
;│数据库密码 │
;│==================================================================│
;│返回结果 │
;│$read_data │
;└──────────────────────────────────────────────────────────────────┘
;Local $TNT
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdbfile& ";Jet Oledb:Database Password=" &$mdb_pass)
$RS =ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open ("Select * From EXITTOLLCAR")
while Not $RS.eof And Not $RS.bof
if @error =1 Then ExitLoop
If $RS.Fields (10).value="" Then
$EXITCARNO=$RS.Fields (9).value
Else
$EXITCARNO=$RS.Fields (10).value
EndIf
If $EXITCARNO<>"" Then
IniWrite("temp.ini",@YDAY&"机器数据",$RS.Fields (1).value,$RS.Fields (3).value&"|"&$RS.Fields (5).value&"|"& $EXITCARNO&"|"& $RS.Fields (50).value&"|"& $RS.Fields (30).value&"|"& $RS.Fields (31).value )
;/4/EXITTOLLORID/2/EXITTIME/6/ENTRYSUID/11/EXITCARNO/51/AXISTYPE/32/NORMALFARE
;$data=IniReadSection ( "temp.ini","data" )
;For $i=0 To $data
;_ArrayAdd($TNT,$data[$i])
;Next
;$newdata=IniRead("temp.ini","data",_ArrayMax($TNT, 0, 1),"")
;FileDelete ( "temp.ini" )
endif
$rs.movenext
WEnd
$rs.close
$addfld.Close
;Return $newdata
EndFunc
Func updata_mdb($data,$rma,$mdb_file,$mdb_pasw)
;┌──────────────────────────────────────────────────────────────────┐
;│==================================================================│
;│更新数据库内容 │
;│==================================================================│
;│数据报 │
;│*.mdb │
;│数据库密码 │
;│==================================================================│
;│返回结果 │
;│$read_data │
;└──────────────────────────────────────────────────────────────────┘
;$temp=StringReplace($data,"@T","")
;MsgBox(0,$mdb_file&" updata",$temp)
$addfl = ObjCreate("ADODB.Connection")
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdb_file& ";Jet Oledb:Database Password=" &$mdb_pasw)
$addfld.execute("update EXITTOLLCARsetNORMALFARE = '"&$rma&"',DEALSTATUS ='1' WHERE EXITCARNO = '"&$data&"'" )
$addfld.close
Sleep(100)
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdb_file& ";Jet Oledb:Database Password=" &$mdb_pasw)
$RS =ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open ("Select * From EXITTOLLCAR")
while Not $RS.eof And Not $RS.bof
if @error =1 Then ExitLoop
If $RS.Fields (10).value="" Then
$EXITCARNO=$RS.Fields (9).value
Else
$EXITCARNO=$RS.Fields (10).value
EndIf
If $EXITCARNO=$data Then
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":.."&@MSEC,$RS.Fields (10).value&"数据改写"&$RS.Fields (30).value)
endif
$rs.movenext
WEnd
$rs.close
$addfld.Close
EndFunc
Func del($data,$mdb_file,$mdb_pasw)
;┌──────────────────────────────────────────────────────────────────┐
;│==================================================================│
;│删除数据库内容 │
;│==================================================================│
;│数据报 │
;│*.mdb │
;│数据库密码 │
;│==================================================================│
;│返回结果 │
;│无 │
;└──────────────────────────────────────────────────────────────────┘
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &$mdb_file& ";Jet Oledb:Database Password=" &$mdb_pasw)
$sQuery ="DELETE FROM EXITTOLLCAR IN '" & $mdb_file & "' WHERE EXITCARNO = '"&$data&"'"
$addfld.execute($sQuery)
$addfld.close
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"数据删除成功"&$data)
EndFunc
; 主要数据处理单元
While 1
If FileExists("c:\read.ini") Then
FileDelete("c:\read.ini")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"远程文件删除成功",@IPAddress1)
EndIf
$var =Ping("100.230.179.108",250)
If $var Then
Global $URL = "100.230.179.108"
Global $us = ""
Global $PS = ""
Else
Global $URL = "192.168.1.115"
Global $us = ""
Global $PS = ""
EndIf
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"IP地址变更"&@IPAddress1)
_down($URL,$us,$PS)
;获取FTP服务器上的配置文件
$date="D:\jiaoyan\toll\LaneData\"&@YEAR&"-"&@MON&"\"
;指定LaneData下目录位置
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"指定LaneData下目录",$date)
$bak="D:\jiaoyan\toll\bak\"&@YEAR&"-"&@MON&"\"
;指定bak下目录位置
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"指定bak下目录",$bak)
$FileListbak =_FileListToArray($bak,"*.mdb",1)
If @error = 1 Then
;MsgBox(0, "", "No Folders Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取BAK失败"&@MSEC)
;_UP($IP,"","")
Exit
EndIf
If @error = 4 Then
;MsgBox(0, "", "No Files Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"获取BAK文件失败"&@MSEC)
;_UP($IP,"","")
Exit
EndIf
$x1=$FileListbak
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"获取BAK目录文件",$FileListbak[$x1])
$FileList =_FileListToArray($date,"*.mdb",1)
If @error = 1 Then
;MsgBox(0, "", "No Folders Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&"-"&@MSEC,"获取LaneData失败"&@MSEC)
;_UP($IP,"","")
Exit
EndIf
If @error = 4 Then
;MsgBox(0, "", "No Files Found.")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&"-"&@MSEC,"获取LaneData文件失败"&@MSEC)
;_UP($IP,"","")
Exit
EndIf
$x=$FileList
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"获取LaneData目录文件",$FileList[$x])
;_ArrayDisplay($FileList, "$FileList")
If @error<>1 And @error<>4 Then
$x=$FileList
For $t=0 To $x Step +1
mdb($date&$FileList[$x],"19710912")
;mdb("d:\1.mdb","19710912")
Next
EndIf
$var =Ping("100.230.179.254",250)
If $var Then
Global $URL = "100.230.179.108"
Global $us = ""
Global $PS = ""
Else
Global $URL = "192.168.1.115"
Global $us = ""
Global $PS = ""
EndIf
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"IP地址变更"&@IPAddress1)
_UP($URL,$us,$PS)
If FileExists("c:\read.ini") Then
$EXITCARNO=IniRead("c:\read.ini","反回数据","车牌","")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"接受车牌",$EXITCARNO)
$rma=IniRead("c:\read.ini","反回数据","钱数","0")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"接受钱数",$rma)
Else
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":."&@MSEC,"接收文件写入失败")
EndIf
$x=$FileList
$x1=$FileListbak
If $EXITCARNO="" Then
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":."&@MSEC,"接收文件无数据")
Else
If $rma>0 Then
;updata 改写数据
updata_mdb($EXITCARNO,$rma,$date&$FileList[$x],"19710912")
updata_mdb($EXITCARNO,$rma,$date&$FileListbak[$x1],"19710912")
Else
;del删除数据
del($EXITCARNO,$date&$FileList[$x],"19710912")
del($EXITCARNO,$date&$FileListbak[$x1],"19710912")
EndIf
$var =Ping("100.230.179.254",250)
If $var Then
Global $URL = "100.230.179.108"
Global $us = ""
Global $PS = ""
Else
Global $URL = "192.168.1.115"
Global $us = ""
Global $PS = ""
EndIf
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC,"IP地址变更"&@IPAddress1)
_UP($URL,$us,$PS)
EndIf
Sleep(10000)
If FileExists("temp.ini") Then
FileDelete("temp.ini")
IniWrite("temp.ini","系统提示",@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&"本地文件删除成功",@MSEC)
EndIf
WEnd
樓主你的這個腳本呢?<Au3_Thread.au3> 回复 5# txen548 没有环境,查错较难。好象不算技术上的问题,可以先从调试方法上入手吧。在无法用脚本来调试的话,我的方法是关注每一个数组变量,多用UBound判断一下,或数组变量较多的话,多加几个msgbox,以确定出错的数组变量在程序哪一段中。 你不要编译成exe,直接用脚本调试,不就找到错误的地方了. 直接调试的时候没有错误。 本帖最后由 anice00 于 2014-2-22 17:01 编辑
没有高人吗~~~~~~~~~~~~~~ 如果需要本人接单请联系本人QQ 淘宝先拍定金拿到版本后确认付款~ 2相无欺骗
请联系 QQ178498498 没有很仔细地看完,但我觉得还是建个sqlserver+花生壳靠谱些。
页:
[1]