Perl 对 Windows 注册表的操作

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

 use Win32::Registry ;

 $key = "SOFTWARE\\newKey";
 $HKEY_LOCAL_MACHINE->Open($key, $keyList);
 print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
 $keyList->GetKeys(\@subKeys);
 $numberOfSubKeys = @subKeys;
 print "\tThere is $numberOfSubKeys key\n";
 foreach $subKey (@subKeys){
    print "\t\t$subKey\n";
 }
 print "\nCreating the Perl6 Key\n";
 $keyList->Create("Perl6",$newKeyList);
 print "Under HKEY_LOCAL_MACHINE\n\tyourValue\n";
 $keyList->GetKeys(\@newSubKeys);
 $numberOfSubKeys = @newSubKeys;
 print "\tThere are now $numberOfSubKeys keys\n";
 foreach $subKey (@newSubKeys){
       print "\t\t$subKey\n";
 }
 $keyList->Close();
 $newKeyList->Close();