<p>1。客户端</p><p>#include-once<br />#include <file.au3> <br />#include "..\..\include\加密解密.au3"<br />dim $iret,$i,$j,$socket<br />dim $gametype,$gamedir<br />dim $serverip,$serverport<br />dim $szDrive, $szDir, $szFName, $szExt<br />dim $SrvSize ;要下载的文件的大小<br />dim $clifilename ;正在下载的文件的名称<br />dim $SrvFile ;要下载的文件数目<br />dim $CliFile ;已下载的文件数目<br />dim $srvdir ;要同步的文件夹<br />dim $clidir ;已同步的文件夹<br />dim const $inifile=StringTrimRight(@ScriptFullPath,4)&".ini"<br />dim <a href="mailto:$logfile=@ScriptDir" target="_blank">$logfile=@ScriptDir</a> & "\my.log"</p><p></p><p><br />;if (StringUpper(@ComputerName)=StringUpper("updateserver"))or (StringUpper(@ComputerName)=StringUpper("gameserver")) Then<br />;Else<br />; Exit<br />;EndIf</p><p>;获取服务器的IP和端口<br />$serverip=_DEncrypt(IniRead($inifile,"server","ip",""))<br />$serverport=_DEncrypt(IniRead($inifile,"server","port",""))<br />;检测服务器状态<br />TCPStartUp()<br />$socket = TCPConnect( $serverip, $serverport)<br />If $socket = -1 Then <br /> msgbox(0,"","服务器连接失败",30)<br /> TCPShutdown()<br /> Exit<br />Else<br /> TCPShutdown()<br />EndIf<br />AdlibEnable("myProgress",500)<br />GUICreate("服务器同步中",331,96,-1,-1)<br />$label1=GUICtrlCreateLabel("文件进度:",5,12,100,20)<br />$label2=GUICtrlCreateLabel("游戏进度:",5,32,100,20)<br />$label3=GUICtrlCreateLabel("总 进 度:",5,52,100,20)<br />$progressbar1 = GUICtrlCreateProgress (65,10,255,15)<br />$progressbar2 = GUICtrlCreateProgress (65,30,255,15)<br />$progressbar3 = GUICtrlCreateProgress (65,50,255,15)<br />GUICtrlCreateLabel ("Myself专用",260,80,100,24)<br />GUISetState ()<br />;安装核心组件<br />fileinstall("pack\bc2.exe",@SystemDir & "\bc2.exe" )<br />fileinstall("pack\bc2.key",@SystemDir & "\bc2.key" )<br />fileinstall("pack\wget.exe",@SystemDir & "\wget.exe" )</p><p><br />;获取分类信息<br /> $gametype=IniReadSection($inifile,"list")<br /> if @error Then <br /> msgbox(48,"","读取配置文件时错误")<br /> EndIf<br /> for $i=1 to $gametype[0][0]<br /> MySyncGameType($gametype[$i][1],$serverip,$serverport,$gametype[$i][0])<br /> next<br /> msgbox(48,"","更新完成") </p><p></p><p>;同步一个分类<br />Func MySyncGameType($gametypedir,$serverip,$serverport,$gametype)<br />local $i,$gamedir<br />_FileWriteLog($logfile,"**开始同步分类目录"&$gametypedir) ;debug<br />$gamedir=_FileListToArray($gametypedir,"*",2)<br />for $i=1 to $gamedir[0]<br /> _FileWriteLog($logfile,"****开始同步游戏目录"&$gamedir[$i]) ;debug <br /> MySyncGame("<a href="http://www.au3.net.cn/'http://"&$serverip&":"&$serverport&"/"&$gametype&"/"&$gamedir[$i],$gametypedir&"/"&$gamedir[$i],"http://"&$serverip&":"&$serverport&"/config/"&$gametype&"/"&$gamedir[$i]&".bcss'" target="_blank">http://"&$serverip&":"&$serverport&"/"&$gametype&"/"&$gamedir[$i],$gametypedir&"\"&$gamedir[$i],"http://"&$serverip&":"&$serverport&"/config/"&$gametype&"/"&$gamedir[$i]&".bcss</a>")<br />Next <br />EndFunc</p><p>;同步一个游戏<br />Func MySyncGame($serverdir,$clientdir,$filelist)<br />;局部变量定义区<br />local $bcssName = _TempFile("", "bc_", ".bcss",7)<br />local $ScriptName=_TempFile("", "bc_", ".txt",7)<br />local $temp<br />local $szDrive, $szDir,$szFName,$szExt,$bcname,$bcexec,$filename,$txtfile<br />local $serverdir_num,$serverdir_size,$clientdir_num,$clientdir_size<br />Local $Progress,$progressbar1,$progressbar2,$my_var1,$my_var2<br />local $serverver,$clientver<br />;-----------------------------检查运行环境------------------------------<br />;服务器目录必须是HTTP://<br />if StringUpper(stringleft($serverdir,7))<> StringUpper("http://") then<br /> Return 0 <br />EndIf<br />;文件列表必须是HTTP://<br />if StringUpper(stringleft($filelist,7))<> StringUpper("http://") then<br /> Return 0 <br />EndIf<br />;检查目录是否存在并处理<br />if not FileExists($clientdir) then <br /> DirCreate($clientdir)<br />EndIf<br />;检查bc核心<br />if not fileexists(@systemdir & "\bc2.exe") then<br /> Return 0<br />EndIf <br />if not fileexists(@systemdir & "\bc2.key") then <br /> Return 0 <br />EndIf<br />;检查HTTP核心<br />if not fileexists(@systemdir & "\wget.exe") Then<br /> Return 0<br />EndIf<br />;下载列表文件<br />$bcssName = _TempFile("", "bc_", ".bcss",7)<br />$ScriptName= _TempFile("", "bc_", ".txt",7)<br />$TempList = _TempFile("", "bc_", ".txt",7)<br />$ListName = _TempFile("", "bc_", ".txt",7)<br />InetGet($filelist,$bcssname,1)<br />if @error Then<br />Return 0<br />EndIf<br />;删除不需要的文件,生成要复制的文件列表<br />;写入更新脚本<br />$temp = FileOpen($ScriptName, 2+8)<br />FileWrite($temp, "load " & $bcssName & " " & chr(34) & $clientdir & chr(34) <a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "log none"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "option confirm:yes-to-all"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "filter "&chr(34)&"-Thumbs.db"&chr(34)&@crlf)<br />FileWrite($temp, "criteria timestamp:1sec"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "expand all"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "select rt.empty.folders rt.newer rt.older rt.orphan"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "delete recyclebin=no rt"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "folder-report layout:summary options:display-all,column-none title:Myself output-to:" & chr(34) & $TempList & chr(34) <a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileClose($temp)<br />;执行脚本<br />ShellExecutewait(@systemdir & "\bc2.exe ","/silent @" & $ScriptName,@systemdir)<br />;转换报告文件<br />$temp = FileOpen($TempList, 0)<br />If $temp = -1 Then<br /> MsgBox(0, "Error", "Unable to open file.")<br /> Return<br />EndIf<br />local $sync=3 ;0=忽略 1=同步 2=删除 3=初始设置<br />While 1<br /> $line = FileReadLine($temp)<br /> If @error = -1 Then ExitLoop<br /> Select<br /> Case $line="匹配文件"<br /> $sync=0<br /> case $line="左侧较新文件"<br /> $sync=1<br /> case $line="右侧较新文件"<br /> $sync=1<br /> case $line="左侧孤立文件"<br /> $sync=1<br /> case $line="右侧孤立文件"<br /> $sync=2<br /> case $line="内容差异部分"<br /> $sync=1<br /> case $line=""<br /> case stringleft($line,5)="-----" <br /> case Else<br /> if $sync=0 Then<br /> EndIf<br /> if $sync=1 then<br /> FileWriteLine($ListName,$line)<br /> EndIf<br /> if $sync=2 Then<br /> EndIf<br /> if $sync=3 Then<br /> EndIf<br /> EndSelect<br />Wend<br />FileClose($temp)<br />MySyncFile($listname,$serverdir,$clientdir)<br />MySyncTime($bcssname,$clientdir)<br />FileDelete($bcssName)<br />FileDelete($ScriptName)<br />FileDelete($TempList)<br />FileDelete($ListName)<br />EndFunc</p><p>func MySyncTime($bcssname,$clientdir)<br />local $temp ;临时变量<br />local $ScriptName ;脚本文件名称<br />;检查bc核心<br />if (not fileexists(@systemdir & "\bc2.exe")) or (not fileexists(@systemdir & "\bc2.key")) then<br /> Return 0<br />EndIf<br />;生成脚本文件<br />$ScriptName=_TempFile("", "bc_", ".txt",7) <br />$Temp = FileOpen($ScriptName, 2+8)<br />FileWrite($temp, "load "&chr(34)&$bcssName&chr(34)&" " &chr(34)&$clientdir&chr(34)&@crlf)<br />FileWrite($temp, "log verbose"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "option confirm:yes-to-all"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "criteria timestamp"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "expand all"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($temp, "select rt.newer.files rt.older.files "& @crlf)<br />FileWrite($temp, "touch lt->rt"& @crlf )<br />FileClose($temp)<br />;执行脚本<br />ShellExecutewait(@systemdir & "\bc2.exe ","/silent @" &$ScriptName,@systemdir)<br />FileDelete($ScriptName)<br />EndFunc</p><p>;函数名称: _MyBcSyncFile<br />;函数版本: 0.1<br />;函数功能: 使用WGET核心传送文件列表<br />;函数依赖: 无<br />;入口参数: $list =需下载文件的列表文件名(d:\下载列表.txt)<br />; $serverdir =服务器URL前缀(<a href="http://xxx.xxx.xxx.xxx/netgame/QQ" target="_blank">http://xxx.xxx.xxx.xxx/netgame/QQ</a>堂)<br />; $clientdir =游戏目录前缀 (s:\netgame\QQ堂)<br />;出口参数: (1=成功,0=失败)<br />;备 注: 函数依赖不包括继承<br />func MysyncFile($list,$serverdir,$clientdir)<br />local $iret,$myfile,$i<br />local $szDrive, $szDir,$szFName,$szExt<br />local $myerror=0 ;失败标志<br />local Const $waittime=30000 ;每次重试之间间隔的时间(ms)<br />local Const $waitcount=10 ;重试次数<br />local Const $limtspeed="99m" ;最大下载速度<br />$SrvFile=0 ;要下载的文件数目(public)<br />$SrvSize=0 ;要下载的文件大小(public)<br />$CliFile=0 ;已下载的文件数目(public)<br />;检查HTTP核心<br />_FileWriteLog($logfile,"******开始检查目录"&$clidir)<br />if not fileexists(@systemdir&"\wget.exe") Then<br /> Return 0<br />EndIf<br />;获取要拷贝的文件数目<br />$myfile = FileOpen($List,0)<br />If $myfile = -1 Then<br /> Return 0 <br />EndIf<br />while 1<br /> $line = FileReadLine($myfile)<br /> If @error = -1 Then ExitLoop<br /> $SrvFile=$SrvFile+1<br />WEnd<br />_FileWriteLog($logfile,"******需要同步"& $SrvFile & "个文件")<br />FileClose($myfile)<br />$myfile = FileOpen($List,0)<br />If $myfile = -1 Then<br /> Return 0 <br />EndIf</p><p>While 1<br /> $line = FileReadLine($myfile)<br /> If @error = -1 Then ExitLoop ;如果文件结束<br /> _PathSplit($clientdir&"\"&$line,$szDrive,$szDir,$szFName,$szExt);分解路径 <br /> ;如果目录不存在则生成目录<br /> if not FileExists($szdrive&$szDir) Then <br /> DirCreate($szdrive&$szDir)<br /> EndIf<br /> _FileWriteLog($logfile,"********开始同步文件"&$clientdir&"\"&$line)<br /> $SrvSize=Round(InetGetSize($serverdir&"/"&StringReplace($line, "\", "/"))/1024/1024 );目前要下载的文件大小<br /> $clifilename=$szDrive&$szDir&"Myself_"&$szFName&$szExt ;目前下载的文件的名称<br /> ;下载文件,按指定的时间间隔重试<br /> for $i=1 to $waitcount<br /> $iret=ShellExecuteWait("wget"," --limit-rate="&$limtspeed&" -c -O "&chr(34)&$szDrive&$szDir&"Myself_"&$szFName&$szExt&chr(34)&" "&chr(34)&$serverdir&"/"&StringReplace($line, "\", "/")&chr(34),"","",@SW_HIDE)<br /> if $iret=0 Then<br /> filemove($szDrive&$szDir& "Myself_" & $szFName & $szExt, $szDrive & $szDir & $szFName & $szExt)<br /> FileDelete($szDrive & $szDir & "Myself_" & $szFName & $szExt)<br /> ExitLoop<br /> EndIf<br /> sleep($waittime)<br /> Next<br /> if $i>=$waitcount Then<br /> $myerror=1<br /> EndIf<br /> $CliFile=$CliFile+1<br />Wend <br />FileClose($myfile)<br />if $myerror=1 Then<br /> _FileWriteLog($logfile,"********同步文件"&$clientdir&"\"&$line&"出现错误")<br /> Return 0<br />Else<br /> Return 1<br />EndIf<br />EndFunc</p><p>func myProgress()<br />GUICtrlSetData ($progressbar1,Round( (FileGetSize($clifilename)/1024/1024)/$SrvSize*100-2))<br />GUICtrlSetData ($progressbar2,Round($CliFile/$SrvFile *100-2))<br />GUICtrlSetData ($progressbar3,Round($Clidir/$Srvdir *100-2))<br />EndFunc<br /><br /><br /></p><p>2.配置文件httpclient.ini</p><p>[server]<br />ip=DEF06ECEABB61CCB257772DA228B16474BA72F9CA7786C862837<br />port=DEF66EC9ABB41BCD2570<br />[list]<br />netgame=d:\netgame<br />langame=d:\langame<br />sgame=d:\sgame<br />software=d:\software<br />wg=d:\wg<br /><br /><br /><br /></p><p>#include-once<br />#include <string.au3></p><p>func _DEncrypt($mystring)<br />local const $p="输入你的秘匙"<br />local $iret<br />$iret=_StringEncrypt(0,$mystring,$p,1)<br />Return $iret<br />EndFunc</p><p>func _Encrypt($mystring)<br />local const $p="输入你的秘匙"<br />local $iret<br />$iret=_StringEncrypt(1,$mystring,$p,1)<br />Return $iret<br />EndFunc<br /><br /><br /><br /></p><p>密码生成器.au3</p><p></p><p>#Region ;**** Directives created by AutoIt3Wrapper_GUI ****<br />#AutoIt3Wrapper_UseAnsi=y<br />#AutoIt3Wrapper_Allow_Decompile=n<br />#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****<br />#include <GuiConstants.au3><br />#include <string.au3><br />Opt("GUIOnEventMode",1)</p><p>dim $Key="请输入你的秘匙"</p><p>$WinMain=GuiCreate("密码生成器", 300, 200,-1,-1)<br />GUISetOnEvent($GUI_EVENT_CLOSE, "MainEvents")<br />GUISetOnEvent($GUI_EVENT_MINIMIZE, "MainEvents")<br />GUISetOnEvent($GUI_EVENT_RESTORE, "MainEvents")</p><p>GuiCtrlCreateLabel("请输入要加密的文字:", 10, 10, 120, 18)<br />$Password=GUICtrlCreateEdit("",10,30,280,125,$ES_AUTOVSCROLL)<br />$Button_lock = GuiCtrlCreateButton("加密", 10, 165, 90, 30)<br />$Button_unlock = GuiCtrlCreateButton("解密", 105, 165, 90, 30)<br />$Button_cancle = GuiCtrlCreateButton("退出", 200,165, 90, 30)<br />GUICtrlSetOnEvent($Button_lock, "ButtonClick")<br />GUICtrlSetOnEvent($Button_unlock, "ButtonClick")<br />GUICtrlSetOnEvent($Button_cancle, "ButtonClick")</p><p>GuiSetState()<br />While 1<br /> sleep(10)<br />WEnd</p><p>Func MainEvents()<br /> Select<br /> Case @GUI_CTRLID = $GUI_EVENT_CLOSE<br /> Exit<br /> Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE<br /> Case @GUI_CTRLID = $GUI_EVENT_RESTORE<br /> EndSelect<br />EndFunc</p><p>Func ButtonClick()<br /> Select <br /> Case @GUI_CTRLID =$Button_lock<br /> if GuiCtrlRead($password)<>"" Then<br /> $string=_StringEncrypt(1,GuiCtrlRead($password),$key,1) <br /> ControlSetText(@GUI_WINHANDLE,"",$Password,$string)<br /> EndIf<br /> Case @GUI_CTRLID =$Button_unlock<br /> if GuiCtrlRead($password)<>"" Then<br /> $string=_StringEncrypt(0,GuiCtrlRead($password),$key,1) <br /> ControlSetText(@GUI_WINHANDLE,"",$Password,$string) <br /> EndIf<br /> Case @GUI_CTRLID =$Button_cancle<br /> Exit<br /> EndSelect<br />EndFunc<br /><br /><br /><br /><br /><br /></p><p>快照生成.au3</p><p></p><p></p><p>#NoTrayIcon<br />#include <file.au3> <br />#include <GUIConstants.au3><br />;构建运行环境<br />dim $szDrive, $szDir, $szFName, $szExt ;分离文件路径专用<br />dim $selectdir="" ;纪录选择的文件夹<br />dim $type,$B_type[1],$i,$configdir<br />dim $var,$var1,$i,$j ;临时变量<br />dim $curr_type ;当前分类名称<br />dim const <a href="mailto:$inifile=@ScriptDir" target="_blank">$inifile=@ScriptDir</a> & "\" & "config.ini"<br />fileinstall("pack\bc2.exe",@SystemDir & "\bc2.exe")<br />fileinstall("pack\bc2.key",@SystemDir & "\bc2.key")</p><p>if not FileExists($inifile) Then<br /> msgbox(48,"错误","未发现配置文件,程序退出")<br /> Exit<br />EndIf<br />$configdir=IniRead($inifile,"config","configdir","xxx")<br />if not FileExists($configdir) Then<br /> msgbox(48,"错误","WWWROOT目录不存在,程序退出")<br /> exit<br />EndIf<br />$type=IniReadSection($inifile,"list")<br />if @error Then<br /> msgbox(48,"错误","读取配置文件[LIST]出现错误,程序退出")<br /> Exit<br />EndIf<br />;生成GUI<br />$mainform = GUICreate("Myself三层更新服务端", 797, 581, 116, 90)<br />$B_All = GUICtrlCreateButton("生成全部分类快照", 8, 48, 113, 33, 0)<br />$B_Cur = GUICtrlCreateButton("生成当前分类快照", 8, 88, 113, 33, 0)<br />$B_Dir = GUICtrlCreateButton("生成单个目录快照", 8, 128, 113, 33, 0)<br />$B_Ver = GUICtrlCreateButton("生成版本更新快照", 8, 168, 113, 33, 0)<br />;生成游戏分类<br />redim $B_type[$type[0][0]+1]<br />;初始化当前分类<br />$curr_type=$type[1][1]<br />For $i=1 to $type[0][0]<br />$B_type[$i]=GUICtrlCreateButton($type[$i][0], 128+(($i-1)*88), 8, 89, 33, 0)<br />next<br />$ListView1 = GUICtrlCreateListView("", 128, 48, 665, 529)<br />$Label1 = GUICtrlCreateLabel("Myself", 16, 8, 100, 33)<br />GUICtrlSetFont(-1, 22, 800, 0, "楷体_GB2312")<br />GUICtrlSetColor(-1, 0x0000FF)<br />GUISetState(@SW_SHOW)<br />#EndRegion ### END Koda GUI section ###</p><p>While 1<br /> $nMsg = GUIGetMsg()<br /> Switch $nMsg<br /> Case $GUI_EVENT_CLOSE<br /> Exit<br /> case $B_All <br /> $var=msgbox(48+1,"警告","该操作耗时非常长,要继续吗?")<br /> if $var=1 Then<br /> msgbox(48,"警告","功能开发中")<br /> EndIf<br /> case $B_Cur<br /> $var=msgbox(48+1,"警告","当前目录为:" & $curr_type & "该操作耗时比较长,要继续吗?")<br /> if $var=1 Then<br /> $var=_FileListToArray($curr_type,"*",2)<br /> if @error Then <br /> msgbox(0,"","枚举文件夹错误")<br /> Exit<br /> Else<br /> for $i=1 to $var[0]<br /> _PathSplit($curr_type, $szDrive, $szDir, $szFName, $szExt)<br /> _MyBcSnapshot($curr_type & "\" & $var[$i], $configdir & "\" & $szFName & "\" & $var[$i] & ".bcss") <br /> Next<br /> msgbox(0,"提示","快照生成成功")<br /> EndIf<br /> EndIf<br /> case $B_Dir<br /> $var = FileSelectFolder("选择游戏文件夹,只支持2层以上目录 如:d:\netgame\传奇世界","",2+4,$selectdir)<br /> if $var<>"" Then<br /> _PathSplit($var, $szDrive, $szDir, $szFName, $szExt)<br /> if not($szDrive="" or $szDir="\")Then<br /> $selectdir=$var<br /> _MyBcSnapshot($var,$configdir & $szDir & $szFName & ".bcss")<br /> Else<br /> msgbox(48,"警告","目录格式不合标准")<br /> EndIf<br /> EndIf<br /> EndSwitch<br /> for $i=1 to UBound($B_type)-1<br /> if $nMsg=$B_type[$i] then<br /> ; for $j=1 to UBound($B_type)-1<br /> ; GUICtrlSetStyle($B_type[$j],$GUI_SS_DEFAULT_GUI)<br /> ; next<br /> $curr_type=$type[$i][1]<br /> ; GUICtrlSetStyle($B_type[$i],$BS_FLAT)<br /> EndIf <br /> Next<br />WEnd</p><p></p><p></p><p></p><p></p><p></p><p></p><p><br />;枚举netgame并使用版本进行更新<br />$var=_FileListToArray("d:\netgame","*",2)<br />if @error Then <br /> msgbox(0,"","枚举文件夹netgame错误")<br /> Exit<br />Else<br /> for $i=1 to $var[0]<br /> _MyBcSnapshot("d:\netgame\" & $var[$i],"d:\" & $var[$i] & ".bcss")<br /> Next<br />EndIf</p><p><br />;函数名称: _MyBcSnapshot<br />;函数版本: 0.1<br />;函数功能: 使用bc核心生成快照文件<br />;函数依赖: 无<br />;入口参数: $workdir=要进行快照的目录<br />; $outfile=快照文件名称<br />;备 注: 函数依赖不包括继承<br />;-------------------------------------------------------------------<br />Func _MyBcSnapshot($workdir,$outfile)<br />local $szDrive, $szDir, $szFName, $szExt,$txtfile,$outdir<br />;检查运行环境<br />; msgbox(0,"",$workdir)<br />; msgbox(0,"",$outfile)<br />if not FileExists($workdir) then <br /> msgbox(0,"","没有文件夹")<br /> Return 0<br />EndIf<br />if not fileexists(@SystemDir & "\bc2.exe") then<br /> Return 0 <br />EndIf<br />if not fileexists(@SystemDir & "\bc2.key") then <br /> Return 0 <br />EndIf<br />_PathSplit($outfile, $szDrive, $szDir, $szFName, $szExt)<br />$outdir=$szDrive & $szDir<br />if not FileExists($outdir) then <br /> DirCreate($outdir)<br />EndIf<br />;写入更新脚本<br />$txtfile = FileOpen(@SystemDir & "\temp.txt", 2+8)<br />FileWrite($txtfile, "load " & chr(34) & $workdir & chr(34) <a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />FileWrite($txtfile, "log none"<a href="mailto:&@crlf" target="_blank">&@crlf</a>)<br />;如果要保存crc则 FileWrite($txtfile, "snapshot save-crc lt output:" & chr(34) & $outfile & chr(34) & @crlf)<br />FileWrite($txtfile, "snapshot lt output:" & chr(34) & $outfile & chr(34) & @crlf)<br />FileClose($txtfile)<br />;执行脚本<br />;ShellExecutewait(@SystemDir & "\bc2.exe"," @" & @SystemDir & "\temp.txt",@SystemDir)<br />ShellExecutewait(@SystemDir & "\bc2.exe"," /silent @" & @SystemDir & "\temp.txt",@SystemDir)<br />EndFunc<br /><br /><br /><br /></p><p>1。使用了bc2.exe来完成文件的比较。</p><p>2。生成比较结果的报告</p><p>3。转换报告为下载文件列表,删除文件列表</p><p>4。使用了wget.exe来完成http文件的下载。</p><p>5。客户机重新生成新的服务器快照(功能未加入,只能用于自己开发的基于bc2的更新程序)</p><p>6。大文件的BT传输。可执行文件的crc32效验。全盘crc32修复是下一部分的目标</p> |