zoukankan      html  css  js  c++  java
  • AutoIT练习

    #cs ----------------------------------------------------------------------------

     AutoIt Version: 
    3.3.6.1
     Author:         myName

     Script 
    Function:
        Template AutoIt script.

    #ce 
    ----------------------------------------------------------------------------

    ; Script Start 
    - Add your code below here

    #cs
    if "love" = "LOVE" then
        
    Exit
        
    msgBox(64,"这是我的标题","yes")
    Else
        
    msgBox(64,"这是我的标题", @WDAY)    
    EndIf
    #ce

    #cs
    Dim $i
    for $i=1 to 5 Step 1 
        
    MsgBox(0,"title","content" & $i)
    Next

    msgbox(0,"title",_fun(1,2))

    Func _fun($a,$b)
        return $a
    +$b
    EndFunc
    #ce

    #cs
    Func _fn($n)
        
    if $n==1 then 
            return 
    1
        
    else
            return _fn($n
    -1+ $n
        EndIf
    EndFunc
        
    MsgBox(0,"title",_fn(10));
    #ce

    #cs
    Global 
    Const $GUI_EVENT_CLOSE = -3;窗口关闭消息的值
    GUICreate(
    "我的第一个窗口") ; 创建一个居中显示的GUI 窗口
    GUISetState(@SW_SHOW) ; 显示一个空白的窗口
    While 1
    $msg 
    = GUIGetMsg();捕获窗口消息
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop;使用关键字ExitLoop 跳出While 循环
    WEnd
    GUIDelete();

    dim $rand=random(0,255,1)
    MsgBox(0,"",$rand);
    #ce

    #cs
    Run(
    "notepad.exe") ;运行记事本
    WinWait(
    "无标题- 记事本") ;等待记事本窗口出现
    $Gui 
    = GuiCreate("被装进了记事本"240120)
    GuiSetState()
    ;DllCall(
    "user32.dll""int""SetParent""hwnd", $Gui, "hwnd",WinGetHandle("无标题- 记事本")) 
    ;使用API 把脚步建立的窗口嵌入记事本窗口中
    Do
    ;
    Do 循环,当窗口消息等于退出消息,或者记事本窗口消失时,就退出循环
    Until GuiGetMsg() 
    =-3 Or Not WinExists("无标题- 记事本")
    #ce

    ;run(
    "notepad.exe","",@SW_MAXIMIZE)
    ;Run(@ComSpec 
    & " /k notepad.exe")

    ;
    dim $ret =inputbox("title","提示","这是默认值")

    ;
    msgbox(0,"",$ret +@LF  ,2)

    run(
    "cmd")
    WinWaitActive(
    "C:\WINDOWS\system32\cmd.exe")
    ;Sleep(
    1)
    Send (
    "ipconfig" & @CRLF)

    Sleep(
    3000)

    Send(
    "exit" & @CRLF)

  • 相关阅读:
    很多人都没用过的轻量级Oracle数据库数据导出工具SQLLDR2——性能超赞
    IT人员必备linux安全运维之Ssh用途、安全性、身份认证以及配置……【转】
    ps aux排序
    Oracle-AWR报告简介及如何生成【转】
    MySQL删除数据几种情况以及是否释放磁盘空间【转】
    MySQL登录问题1045 (28000)处理步骤【原创】
    nginx与PHP的关系和交互方式【转】
    MySQL常见错误代码说明
    xargs -i 和-I 的区别【转】
    linux中的计算【转】
  • 原文地址:https://www.cnblogs.com/wucg/p/1788365.html
Copyright © 2011-2022 走看看