note 30044 added to ref.com
| From: | alex at domini dot net | Date: | Wed, 05 Mar 2003 08:55:51 +0000 |
| Subject: | note 30044 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44851@lists.php.net to get a copy of this message | ||
To manage the Windows Register at HKEY_LOCAL_MACHINE\SOFTWARE\ use these functions:
<?php
/**
* @return string
* @param aplicacio string
* @param nom string
* @desc Retorna el valor del registre HKEY_LOCAL_MACHINE\SOFTWARE\aplicacio\nom
*/
function rtv_registre($aplicacio, $nom)
{
Global $WshShell;
$registre = "HKEY_LOCAL_MACHINE\SOFTWARE\\" . $aplicacio . "\\" . $nom;
$valor = $WshShell->RegRead($registre);
return($valor);
}
/**
* @return string
* @param aplicacio string
* @param nom string
* @param valor string
* @param tipus string
* @desc Actualitza el valor del registre HKEY_LOCAL_MACHINE\SOFTWARE\aplicacio\nom
*/
function put_registre($aplicacio, $nom, $valor, $tipus="REG_SZ")
{
Global $WshShell;
$registre = "HKEY_LOCAL_MACHINE\SOFTWARE\\" . $aplicacio . "\\" . $nom;
$retorn = $WshShell->RegWrite($registre, $valor, $tipus);
return($retorn);
}
//
// Creem una instància del COM que ens serveix per
// accedir al registre de Windows, i la mantenim.
// D'aquesta manera millorem el rendiment.
$WshShell = new COM("WScript.Shell");
?>
--
http://www.php.net/manual/en/ref.com.php
http://master.php.net/manage/user-notes.php?action=edit+30044
http://master.php.net/manage/user-notes.php?action=delete+30044
http://master.php.net/manage/user-notes.php?action=reject+30044