apache php value,PHP运行于Apache 模块方式

"这篇博客展示了如何在PHP运行于Apache模块模式下使用COM组件与WScript.Shell对象交互,来读取和写入Windows注册表。通过示例代码,作者详细解释了如何读取`HKEY_LOCAL_MACHINESOFTWARE7-Zippath`的值,并提供了两个函数,一个用于写入注册表,另一个用于删除注册表项。"
摘要由CSDN通过智能技术生成

PHP运行于Apache 模块方式

$Wshshell= new COM('WScript.Shell');

$data= $Wshshell->regRead('HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\path');

echo "Data is::".$data;

//Function for writing to the registry.

function registry_write($folder, $key, $value, $type="REG_SZ")

{

$WshShell = new COM("WScript.Shell");

$registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder . "\\" . $key;

try{

$result = $WshShell->RegWrite($registry, $value, $type);

echo "Entry is Successfully written at:".$registry;

return($result);

}

catch(Exception $e){

echo "Some Exception in Registry writing".$e;

}

return false;

}

// Function to deleting from the Register Entry.

function registry_delete($folder, $key, $value, $type="REG_SZ")

{

$WshShell = new COM("Wscript.shell");

$registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder . "\\" . $key;

try{

$result = $WshShell->RegDelete($registry);

echo $key." is Successfully deleted from HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder ;

return($result);

}

catch(Exception $e){

echo "Some Exception with the code::".$e;

【PHP运行于Apache 模块方式】相关文章:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值