php-windows Digest 18 Feb 2010 15:12:47 -0000 Issue 3762
Topics (messages 29910 through 29912):
"this variant has no properties"?
29910 by: Thomas Anderson
29911 by: Thomas Anderson
Original Source
29912 by: Harpreet
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
<?php
$wscript = new COM('WScript.Shell');
while (true) {
$random =
$wscript->RegRead('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\RNG\\Seed');
var_dump($random->value);
sleep(1);
echo "\r\n";
}
?>
That gives me a "this variant has no properties" error. My question
is... how on earth does it not have any properties? As the following
VBscript is testament to, it clearly does have properties:
function bin2hex(values)
dim result
for each value in values
temp2 = hex(value)
select case len(temp2)
case 0: result = result & "00"
case 1: result = result & "0" & temp2
case 2: result = result & temp2
end select
next
bin2hex3 = result
end function
Set WshShell = createObject("WScript.Shell")
temp =
WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG\Seed")
MsgBox(bin2hex(temp))
Doing vartype on temp reveals that it's an array of variants (VT_ARRAY
| VT_VARIANT). Even variant_get_type agrees. But how do access the
elements of htat variant array? Can I?
--- End Message ---
--- Begin Message ---
When it comes to doing things with the registry, PHP4 seems to be
better than PHP5:
<?php
$registry = new COM('winmgmts:root/DEFAULT:StdRegProv');
$values = new VARIANT();
echo $registry->getBinaryValue(0x80000002,
'SOFTWARE\\Microsoft\\Cryptography\\RNG', 'Seed', $values);
var_dump($values->value);
?>
That works as expected on PHP4. On PHP5, it gives yet another "this
variant has no properties" error.
On Wed, Feb 17, 2010 at 5:46 PM, Thomas Anderson <zeln...@gmail.com> wrote:
> <?php
> $wscript = new COM('WScript.Shell');
> while (true) {
> $random =
> $wscript->RegRead('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\RNG\\Seed');
> var_dump($random->value);
> sleep(1);
> echo "\r\n";
> }
> ?>
>
> That gives me a "this variant has no properties" error. My question
> is... how on earth does it not have any properties? As the following
> VBscript is testament to, it clearly does have properties:
>
> function bin2hex(values)
> dim result
> for each value in values
> temp2 = hex(value)
> select case len(temp2)
> case 0: result = result & "00"
> case 1: result = result & "0" & temp2
> case 2: result = result & temp2
> end select
> next
> bin2hex3 = result
> end function
>
> Set WshShell = createObject("WScript.Shell")
>
> temp =
> WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG\Seed")
> MsgBox(bin2hex(temp))
>
> Doing vartype on temp reveals that it's an array of variants (VT_ARRAY
> | VT_VARIANT). Even variant_get_type agrees. But how do access the
> elements of htat variant array? Can I?
>
--- End Message ---
--- Begin Message ---
I installed my PHP app on a windows server 2008. The problem is when I
load my first login page it opens another browser instance and the login
page stays there with the word Original Source in its url. If I close
this page manully everything else works like it used to on my XP machine
with a single window.
Now sure why the first window wont get overwritten.
--- End Message ---