au3报错提示,结束windows进程

MsgBox(260, "Error", "系统繁忙,请稍后再试!", 10)
$c=MsgBox(17,"notepad登出警告","若无操作,系统将退出记事本,选择【取消】将取消系统登出.",6)
    If $c<>2 Then 
    ProcessClose(" notepad.exe")
    ProcessClose($list[$i][0])  ;如果进程名中包含就关闭该进程。
    EndIf

隐藏任务栏托盘图标

AutoItSetOption("TrayIconHide",1)

au3一次只运行一个程序

local $key = "【这是一个测试au3程序】"
If WinExists($key) Then
MsgBox(4096, "出错了", "本程序已经运行了一个实例!")
Exit
Endif
AutoItWinSetTitle($key)
MsgBox(4096, "正常工作", "本程序正常启动了!")
;注意/说明
;AutoIt 窗口总是处于隐藏状态的.修改其标题的目的是为了让其它程序(或者其它 AutoIt 脚本程序)能与 AutoIt 交互.

时间

;#include <Date.au3>
;#include <DateTimeConstants.au3>

$goon = MsgBox(260, "info", "name:", 10)
If $goon <> 6 or $goon > 880 Then
    $time_b = @YEAR & "-" & @MON & "-" & @MDAY & " 00:00:00"
MsgBox(0,"",$time_b)
    MsgBox(16, "", "Error",1)
    MsgBox(0,"",@YEAR &"-"& @MON &"-"& "-"& @MDAY &" "&@HOUR &":"&@MIN &":"& @sec &"."&@MSEC)

MsgBox(0,'',"现在时间为:" & @WDAY)

If @WDAY =6 Then
    MsgBox(0,"","今天是周日")
EndIf
#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
Example3();转换时间
Func Example3()
    Local $date, $DTM_SETFORMAT_, $style

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953-04-25", 10, 10, 185, 20)

    ; 设置默认格式(注意帮助上的说明)
    $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
    $style = "yyyy-MM-dd HH:mm:ss"
    GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)

    GUISetState()
    While GUIGetMsg() <> $GUI_EVENT_CLOSE
    WEnd

    MsgBox(0, "Time", GUICtrlRead($date))
EndFunc   ;==>Example3

au3读取ini配置文件

# sqlset.ini配置文件内容如下
[SQLSERVER]
ip="127.0.0.1"
[user]
user="root"
[password]
password="root"
[database]
database="test"
#

;以下为读取ini中存放的远程数据库连接配置文件
Dim $server =IniRead("sqlset.ini","SQLSERVER","ip","localhost")
;MsgBox (4096,"结果",$server)  ;tets
Dim $user =IniRead("sqlset.ini","user","user","root2")
;MsgBox (4096,"结果",$user)  ;test
Dim $pwd =IniRead("sqlset.ini","password","password","root2")
;MsgBox (4096,"结果",$pwd)  ;test
Dim $dbs =IniRead("sqlset.ini","database","database","test2")
;MsgBox (4096,"结果",$dbs)  ;test
;读取配置文件完毕
最后编辑: admin  文档更新时间: 2021-03-16 21:50   作者:admin