當前位置: 首頁>>代碼示例>>PHP>>正文


PHP COM::SendKeys方法代碼示例

本文整理匯總了PHP中COM::SendKeys方法的典型用法代碼示例。如果您正苦於以下問題:PHP COM::SendKeys方法的具體用法?PHP COM::SendKeys怎麽用?PHP COM::SendKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在COM的用法示例。


在下文中一共展示了COM::SendKeys方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isset

 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
/** @require functions */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
$actions = isset($_POST["data"]) ? $_POST["data"] : false;
$send = isset($_GET["send"]) ? $_GET["send"] : false;
$shell = new COM("WScript.Shell");
$shell->AppActivate("Elite - Dangerous (CLIENT)");
if ($actions !== false) {
    foreach ($actions as $action) {
        if (substr($action, 0, 10) != "sleep_for_") {
            if (is_array($action)) {
                $repeat = $action[0];
                $keypress = $action[1];
                for ($i = 0; $i < $repeat; $i++) {
                    $shell->SendKeys($keypress);
                }
            } else {
                $shell->SendKeys("{" . $action . "}");
                echo $action;
            }
        } else {
            $sleep = str_replace("sleep_for_", "", $action);
            usleep($sleep);
        }
    }
    exit;
}
if ($send !== false) {
    $shell->SendKeys($send);
    //write_log($send);
開發者ID:DBnR1,項目名稱:EDTB,代碼行數:31,代碼來源:shipControls.php

示例2: restart

}
if ($mode === "del") {
    echo "Mode: restart (delete tasks)<br>";
    $valid = true;
}
if ($valid) {
    $WshShell = new COM("WScript.Shell");
    $obj = $WshShell->Run("SMS\\putty.exe -serial com5", 5, false);
    echo $obj;
    $WshShell->appactivate("PuTTy");
    $message = null;
    if ($mode === "keep") {
        $message = "SQQPC;RESTART;" . $name . ";0000;SQQPC";
    } else {
        if ($mode === "del") {
            $message = "SQQPC;REBOOT;" . $name . ";0000;SQQPC";
        }
    }
    sleep(1);
    $WshShell->SendKeys("AT{+}CMGF=1{ENTER}");
    $WshShell->SendKeys("AT{+}CMGS=");
    $WshShell->SendKeys("\"" . $number . "\"{ENTER}");
    $WshShell->SendKeys($message);
    sleep(1);
    $WshShell->SendKeys("^{z}");
    sleep(1);
    $WshShell->SendKeys("%{F4}" . "{ENTER}");
    echo "<br>Sent";
} else {
    echo "Wrong mode argument.<br>Message has not been sent.";
}
開發者ID:pcanilho,項目名稱:SMSGateway,代碼行數:31,代碼來源:SMSGW.php


注:本文中的COM::SendKeys方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。