求改错,各位高手请进
下面是一个公告板程序,请各位帮忙改正一下错误,不甚感激。#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GuiConstants.au3>
#Include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
#NoTrayIcon;脚本开始执行时不显示托盘的图标
Dim $Dll
$File = @ScriptDir&"\设置.ini"
DirCreate(@ScriptDir & "\SKIN")
FileInstall("公告内容.txt", @ScriptDir & "\公告内容.txt", 0)
FileInstall("设置.ini", @ScriptDir & "\设置.ini", 0)
FileInstall("SKIN\SKIN.dll", @ScriptDir & "\SKIN\SKIN.dll", 0)
FileInstall("SKIN\VISTA.skf", @ScriptDir & "\SKIN\VISTA.skf", 0)
$infcheck = FileExists(@ScriptDir & "\设置.ini");检查指定文件或目录是否存在
If $infcheck = 0 Then
MsgBox(48,"温馨提醒您:", "未找到程序配置文件,程序将自动创建."& @CRLF &"请将文件内的服务器路径修改成自己的实际路径.")
IniWrite($File, "运行状态", "是否开启","是")
IniWrite($File, "版权信息", "寒秋一剑","QQ:780095")
IniWrite($File, "版权信息", "作者空间","http://780095.qzone.)
IniWrite($File, "服务端IP", "IP","192.168.1.252")
IniWrite($File, "服务端路径", "路径","\\movie\server$\POST")
IniWrite($File, "公告板选项", "连接不上服务器,是否显示公告板","是")
IniWrite($File, "公告板选项", "程序延时关闭时间","30")
IniWrite($File, "公告板样式", "公告板标题","Old Hat Cover/POST")
IniWrite($File, "公告板样式", "标题","最新公告")
IniWrite($File, "公告板样式", "字体颜色","0xB50101")
IniWrite($File, "公告板样式", "字体大小","9")
IniWrite($File, "公告板样式", "使用字体","宋体");判断是否存在配置文件,如果没有则自动创建!
EndIf
;定义变量
$RUN1 = @ScriptDir & "\设置.ini"
$ServerRUN1 = IniRead($RUN1, "服务端路径", "路径", "")
$ServerIP = IniRead($RUN1, "服务端IP", "IP", "")
$Server_RUN1 = $ServerRUN1 & "\设置.ini"
$Server_RUN2 = $ServerRUN1 & "\公告内容.txt"
$Copyright01 = IniRead($RUN1, "版权信息", "寒秋一剑", "")
$Copyright02 = IniRead($RUN1, "版权信息", "作者空间", "")
$POST = "请勿随便修改版权,有需要请联系QQ:780095 "& @CRLF &"欢迎光临作者QQ空间:[url]http://780095.qzone.[/url]"
$RUN2 = IniRead($RUN1, "公告板选项", "连接不上服务器,是否显示公告板", "")
;检查是否修改作者信息
If $Copyright01 <> "QQ:780095" Or $Copyright02 <> "http://780095.qzone. Then
MsgBox(64, "温馨提醒您:", $POST)
Exit
EndIf
;检查服务器网络状态,并从服务器读取配置文件复制到程序目录
If Ping($ServerIP,100) <> 0 then
If Copy() = 2 Then Return 2
Else
If $RUN2 = "否" Then Exit
EndIf
Func Copy()
For $i = 1 To 300
If FileExists($Server_RUN1) Then FileCopy($Server_RUN1, @ScriptDir & "\设置.ini", "1")
Sleep(100)
If FileExists(@ScriptDir & "\设置.ini") = 0 And $i = 300 Then Exit
If FileExists(@ScriptDir & "\设置.ini") Then $i = 300
Next
For $i = 1 To 300
If FileExists($Server_RUN2) Then FileCopy($Server_RUN2, @ScriptDir & "\公告内容.txt", "1")
Sleep(100)
If FileExists(@ScriptDir & "\公告内容.txt") = 0 And $i = 300 Then Exit
If FileExists(@ScriptDir & "\公告内容.txt") Then $i = 300
Next
EndFunc
$Run = IniRead(@ScriptDir & "\设置.ini", "运行状态", "是否开启", "")
If $Run = "否" Then Exit;判断是否开启公告板
$Time = IniRead(@ScriptDir & "\设置.ini", "公告板选项", "程序延时关闭时间", "")
$path = @ScriptDir & "\公告内容.txt";设置变量
$Read = FileRead($path,FileGetSize($path));从此前已打开的文本文件中读取指定数量的字符
AdlibEnable("time", 1000);启用Adlib功能
Dim $x = $Time
$Bulletin = IniRead(@ScriptDir & "\设置.ini", "公告板样式", "标题", "");读取INI文件
$VRE = IniRead(@ScriptDir & "\设置.ini", "公告板样式", "公告板标题", "")
$RGB = IniRead(@ScriptDir & "\设置.ini", "公告板样式", "字体颜色", "")
$Font = IniRead(@ScriptDir & "\设置.ini", "公告板样式", "字体大小", "")
$Font_1 = IniRead(@ScriptDir & "\设置.ini", "公告板样式", "使用字体", "")
$Date = IniRead(@ScriptDir & "\设置.ini", "公告板选项", "更新日期", "")
$Skin = IniRead(@ScriptDir & "\设置.ini", "公告板样式", "皮肤名称", "")
$Reate = GUICreate($VRE, 450, 500, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Group = GUICtrlCreateGroup("", 5, 30, 440, 440);美化框
$Label = GUICtrlCreateLabel($Bulletin, 10 , 10, 430, 20);标题栏
GUICtrlSetStyle(-1, 0x01);设置控件文本居中
GUICtrlSetFont(-1, 12, 800, 0, $Font_1);字体设置
GUICtrlSetColor(-1, $RGB);字体颜色设置
$Edit1 = GUICtrlCreateEdit("", 10, 40, 428, 410, $ES_READONLY, 0);文本框,左侧,上方,宽度,高度
GUICtrlSetData(-1, StringFormat($Read));修改指定控件的相关数据
GUICtrlSetFont(-1, $Font, 0, 0, $Font_1);字体大小,字体样式
GUICtrlSetColor(-1, $RGB);字体颜色
$Labe2 = GUICtrlCreateLabel($Date, 343, 453, 100, 15);读取INI文件的更新时间信息
GUICtrlSetColor(-1, $RGB)
$Time_Labe1 = GUICtrlCreateLabel("", 8, 480, 180, 20);时间倒计时控件
GUICtrlSetColor(-1, 0xff0033);设置控件文本颜色
$Time_Labe2 = GUICtrlCreateLabel("停止倒计时", 343, 480, 70, 20)
$Time_Labe3 = GUICtrlCreateLabel("退出", 416, 480, 50, 20)
GUISetState(@SW_SHOW);调整窗口的状态,@SW_SHOW表示"使已隐藏窗口显示出来"
While 1;基于表达式循环
$nMsg = GUIGetMsg();捕获窗口消息
Select;条件选择语句
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $Time_Labe3
Exit
Case $nMsg = $Time_Labe2
AdlibDisable()
If GUICreate($Time_Labe2) Then MsgBox(0, "温馨提醒您:", "已经关闭了自动倒计时退出程序...", 1);根据选项来执行
EndSelect
WEnd
Func Time();倒计时执行语句
If $x = 0 Then
Exit
EndIf
GUICtrlSetData($Time_Labe1, "程序将在"& $x &"秒后自动关闭..")
$x -= 1
EndFunc