本文整理汇总了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);
示例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.";
}