事情是这样子的,之前在论坛上面看到一个例子.
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
$Form1_1 = GUICreate("清理系统日志", 485, 493, 293, 154)
GUISetOnEvent($GUI_EVENT_CLOSE, "_form1")
$Button1 = GUICtrlCreateButton("清理系统日志", 56, 312, 129, 33, 0)
GUICtrlSetOnEvent($Button1, "_Button1")
GUISetState(@SW_SHOW)
While 1
Sleep(1000)
WEnd
Func _form1()
Exit
EndFunc
Func _Button1()
EndFunc
我想把清理系统日志这段代码放上去,
_CleanEvent(1)
Func _CleanEvent($s = 1)
$strComputer = "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate,(Backup)}!\\" & $strComputer & "\root\cimv2")
Dim $mylogs[4]
$mylogs[1] = "application"
$mylogs[2] = "system"
$mylogs[3] = "security"
For $logs In $mylogs
$colLogFiles = $objWMIService.ExecQuery('Select * from Win32_NTEventLogFile where LogFileName="' & $logs & '"')
For $objLogfile In $colLogFiles
$objLogfile.ClearEventLog()
Next
Next
GUICtrlSetState($Button50, $GUI_DISABLE)
EndFunc
那么这个按钮就会有两个Func,请问类似上面的这种情况,怎么去解决呢?
我想好多跟我一样的新手都一样不知道怎么去处理的,因为语法本身就有错误,在网上面找了两天的例子,没找到类似的.
麻烦知道的帮个忙处理下好吗?如果解决了,我想很多遇到这个问题的人都会感谢这个帖的...
[ 本帖最后由 laojikelly 于 2009-3-25 09:35 编辑 ] |