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


PHP COM::RegDelete方法代碼示例

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


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

示例1: deleteRegistry

 /**
  * Function deletes a value from the registry
  * @param <string> $folder Folder of the registry value
  * @param <string> $key Key of the registry
  * @return <boolean> Whether registry was successfully deleted to or not
  * @category Extra
  * <code>
  *  $result = Extra::deleteRegistry('registry\\path', 'key');
  * </code>
  */
 function deleteRegistry($folder, $key)
 {
     try {
         $WshShell = new COM("Wscript.shell");
         $registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder . "\\" . $key;
         $result = $WshShell->RegDelete($registry);
         echo $key . " is successfully deleted from HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder;
         return $result;
     } catch (Exception $err) {
         return $err->getMessage();
     }
     return FALSE;
 }
開發者ID:johnulist,項目名稱:PHP-Library,代碼行數:23,代碼來源:extra.php

示例2: phpreg

function phpreg()
{
    $shell1 = new COM("wscript.shell") or die("require windows host");
    $action = isset($_POST['action']) ? $_POST['action'] : '';
    echo '<div class="actall"><h5>Windows注冊表讀寫</h5></div>';
    print <<<END
<TR><form action="" method="post">   
<div class="actall"><TD WIDTH=100 VALIGN=TOP ALIGN=CENTER>   
路徑:<input type="hidden" name="action" value="讀取">   
<input type="text" name="rpath" value="{$rpath}" size="70">   
<input class="bt" type="submit" value="讀取"></form><br></TD></TR></div>   
END;
    $rpath = isset($_POST['rpath']) ? $_POST['rpath'] : '';
    $rpath = str_replace("\\\\", "\\", $rpath);
    if ($action == "read") {
        $out = $shell1->RegRead($rpath);
        echo '<pre>' . var_dump($out) . '</pre>';
    }
    print <<<END
<TR><form action="" method="post">   
<div class="actall"><TD WIDTH=100 VALIGN=TOP ALIGN=CENTER>位置:<input type="text" name="wpath" value="{$wpath}" size="70"><BR><br> 
類型:<input type="text" name="wtype" value="{$wtype}" size="20"> 值:<input type="text" name="wvalue" value="{$wvalue}" size="30">
<input type="hidden" name="action" value="write"><input class="bt" type="submit" value="寫入"></form></TD></TR></div>   
END;
    $wpath = isset($_POST['wpath']) ? $_POST['wpath'] : '';
    $wpath = str_replace("\\\\", "\\", $wpath);
    $wtype = isset($_POST['wtype']) ? $_POST['wtype'] : '';
    $wvalue = isset($_POST['wvalue']) ? $_POST['wvalue'] : '';
    if ($action == "write") {
        $shell1->RegWrite($wpath, $wvalue, $wtype);
    }
    print <<<END
<TR><form action="" method="post">   
<div class="actall"><TD WIDTH=100 VALIGN=TOP ALIGN=CENTER>  
位置:<input type="hidden" name="action" value="del">   
<input type="text" name="dpath" value="{$dpath}" size="70">   
<input class="bt" type="submit" value="刪"></form></TD></TR></div>   
END;
    $dpath = isset($_POST['dpath']) ? $_POST['dpath'] : '';
    $dpath = str_replace("\\\\", "\\", $dpath);
    if ($action == "del") {
        $out = $shell1->RegDelete($dpath);
    }
}
開發者ID:mcanv,項目名稱:webshell,代碼行數:44,代碼來源:icesword.php

示例3: delete

 public function delete($key)
 {
     try {
         $result = $this->shell->RegDelete($registry);
         return $result;
     } catch (Exception $e) {
         echo "Delete Registry Key : {$key} error." . PHP_EOL;
         echo "Exception Code " . $e->getCode() . PHP_EOL;
         echo "Exception Message : " . $e->getMessage() . PHP_EOL;
     }
     return false;
 }
開發者ID:pigochu,項目名稱:phpdevserver,代碼行數:12,代碼來源:common.php


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