亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch26.htm

?? prrl 5 programs codes in the book
?? HTM
?? 第 1 頁 / 共 3 頁
字號:

<P>

If you are still having problems, consider re-installing Windows

or calling an expert for help.

<H2><A NAME="UsingtheRegistry"><FONT SIZE=5 COLOR=#FF0000>

Using the Registry</FONT></A></H2>

<P>

At this point, you have some background information about the

Registry, and you know how to make a Registry backup. Let's look

at how to use the Registry. To make Registry access as easy as

possible, I have created an object-oriented module, called <TT>DmmReg.pm</TT>,

for Registry access.<BR>

<p>

<CENTER>

<TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>

<TR><TD><B>Note</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

The module was called <TT>DmmReg</TT> because there is already a module called <TT>Registry.pm</TT> iNCluded with Perl for Win32. However, that module has little documentation and I wanted to create something special for this book.

</BLOCKQUOTE>



</TD></TR>

</TABLE>

</CENTER>

<P>

<P>

The <TT>DmmReg</TT> module was designed

to make Registry access as easy as possible. You do not need in-depth

knowledge of the Registry to use the methods. The examples in

this chapter show you how to open and create keys, read key values,

and list subkeys.<BR>

<p>

<CENTER>

<TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>

<TR><TD><B>Tip</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

On the other hand, you might feel more comfortable changing the Registry if you know more. If so, read Que's <TT><I>Special Edition Using the Windows 95 Registry</I></TT> by Jerry Honeycutt.

</BLOCKQUOTE>



</TD></TR>

</TABLE>

</CENTER>

<P>

<P>

All of the snippets of code that are discussed in the following

sections are collected into one script file called ELST01.PL on

the CD-ROM that accompanies this book. When creating your own

scripts you merely need to cut and paste the lines of code that

you're interested in. You won't need to hunt through four or five

files.

<P>

The next few sections discuss how to do specific Registry tasks

using the <TT>DmmReg</TT> module.

You see how to use the following methods:

<UL>

<LI><TT>openKey()</TT>-This constructor

method will open an existing key. It returns the undefined value

if the requested key can't be found in the Registry.

<LI><TT>createKey()</TT>-This is another

constructor method. It will create a new key and optionally assign

a value to the default name in one step.

<LI><TT>getValue()</TT>-This method

lets you find the value half of a key's name-value pair.

<LI><TT>setValue()</TT>-This method

lets you create or modify a key's name-value pair.

<LI><TT>getKeys()</TT>-This method

returns an array that contains a list of subkeys for a given key.

<LI><TT>getValues()</TT>-This method

returns a hash that contains name-value entries for a given key.

</UL>

<P>

<p>

<CENTER>

<TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>

<TR><TD><B>Tip</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

In order to avoid a bit of potential confusion, let me clarify one thing. The <TT>DmmReg</TT> module has <TT><I>two</I></TT> constructor fuNCtions: <TT>createKey()</TT> and <TT>openKey()</TT>. Both fuNCtions will return an object refereNCe. If you aren't 
sure what constructor fuNCtions are, see <A HREF="ch14.htm" tppabs="http://cheminf.nankai.edu.cn/~eb~/Perl%205%20By%20Example/ch14.htm" >Chapter 14</A>, &quot;What Are Objects?&quot;.

</BLOCKQUOTE>



</TD></TR>

</TABLE>

</CENTER>

<P>

<H3><A NAME="OpeninganExistingKey">

Opening an Existing Key</A></H3>

<P>

To open an existing Registry key, you need only know the key's

name. For example, if you want to determine if a file association

exists for <TT>.pl</TT> files, check

for the existeNCe of the <TT>HKEY_CLASSES_ROOT\.pl</TT>

key like this:

<P>

<IMG SRC="pseudo.gif" tppabs="http://cheminf.nankai.edu.cn/~eb~/Perl%205%20By%20Example/pseudo.gif" BORDER=1 ALIGN=RIGHT><p>

<BLOCKQUOTE>

<I>Specify that this script will use the <FONT FACE="MCPdigital-I">DmmReg</FONT>

module.<BR>

Specify that strict variable checking should be done.<BR>

Declare the <I><FONT FACE="MCPdigital-I">$handle </FONT>variable

to be local to the file.<BR>

Create an object of type <I><FONT FACE="MCPdigital-I">HKEY_CLASSES_ROOT</FONT>

and open the subkey called <FONT FACE="MCPdigital-I">.pl.</FONT>

The <FONT FACE="MCPdigital-I">$handle</FONT> object will hold

the object refereNCe.<BR>

Display a message indicating the existeNCe of the subkey.</I></I></I>

</BLOCKQUOTE>

<BLOCKQUOTE>

<PRE>

use DmmReg;

use strict;



my($handle);



$handle = HKEY_CLASSES_ROOT-&gt;openKey('.pl');

print(&quot;There &quot; . 

     (defined($handle)? &quot;is an&quot; : &quot;is no&quot;) . 

    &quot; association for .pl files\.n&quot;);

</PRE>

</BLOCKQUOTE>

<P>

If your system does not have any file associations defined for

Perl scripts, this program displays:

<BLOCKQUOTE>

<PRE>

There is no association for .pl files.

</PRE>

</BLOCKQUOTE>

<P>

The name of the root key is used as the class name and the subkey

name is passed as the only argument to the openKey method.

<P>

If you need to open a key that is deeper in the hierarchy, simply

add the braNChes to the argument of the openKey method.

<BLOCKQUOTE>

<PRE>

$handle = HKEY_USERS-&gt;openKey('Default\Software\Microsoft\User

information'); 

</PRE>

</BLOCKQUOTE>

<P>

You can also see from this second example that the <TT>DmmReg</TT>

module lets you create more than one type of object. Actually,

you can create a different object for each of the six root keys.

Each class has exactly the same methods and fuNCtionality.

<H3><A NAME="CreatingaNewKey">

Creating a New Key</A></H3>

<P>

Creating a new key is almost as simple as opening an existing

one. You specify the name of the new key, and you optionally specify

a value for the default name-value pair. For example, if you wanted

to create a Registry key that holds the name of the last data

file that your script opened you could do it like this:

<BLOCKQUOTE>

<PRE>

$h = HKEY_LOCAL_MACHINE-&gt;createKey(

                             'SOFTWARE\A Perl Test Script\Last Data File', 

                             'C:\TEST.DAT');

</PRE>

</BLOCKQUOTE>

<P>

The first argument is the name of the key and the second argument

is the data that will be assigned to the default name.<BR>

<p>

<CENTER>

<TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>

<TR><TD><B>Note</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

The most confusing aspect of the Registry and its keys is that each key can have both subkeys and name-value pairs associated with it. The default name is represented by an empty string. The <TT>createKey()</TT> method lets you create a new key and assign 
a value to its default name in one step.

</BLOCKQUOTE>



</TD></TR>

</TABLE>

</CENTER>

<P>

<P>

You can verify that the assignment worked by using the Registry

Editor. The new key and its default value is shown in Figure D.5.

Some programmers refer to this type of information as <I>persistent</I>

because the Registry key will be around even after your script

has ended. If the key specified as the parameter to the <TT>createKey()</TT>

method already exists, then that key will be opened.

<P>

<A HREF="fd-5.gif" tppabs="http://cheminf.nankai.edu.cn/~eb~/Perl%205%20By%20Example/fd-5.gif"><B>Figure D.5 : </B><I>Creating persistent information in the Registry</I>.</A>

<P>

As with the <TT>openKey()</TT> method,

you can specify limited access rights when opening a key. You

can also tell Windows that the key should be kept in memory and

not written to disk-a volatile key. However, this level of detail

is more involved than this brief introducton can cover. Please

read <I>Special Edition Using the Windows 95 Registry</I> if you

need more advaNCed information.

<H3><A NAME="FindingaKeysValue">

Finding a Key's Value</A></H3>

<P>

You can find out a key's value by using the <TT>getValue()</TT>

method in the <TT>DmmReg</TT> module.

For example, to read the name of the data file that was written

in the last section, you do this:

<P>

<IMG SRC="pseudo.gif" tppabs="http://cheminf.nankai.edu.cn/~eb~/Perl%205%20By%20Example/pseudo.gif" BORDER=1 ALIGN=RIGHT><p>

<BLOCKQUOTE>

<I>Specify that this script will use the <FONT FACE="MCPdigital-I">DmmReg

</FONT>module.<BR>

Specify that strict variable checking should be done.<BR>

Declare the <I><FONT FACE="MCPdigital-I">$handle </FONT>and <FONT FACE="MCPdigital-I">$keyName</FONT>

variables to be local to the file.<BR>

Initialize <I><FONT FACE="MCPdigital-I">$keyName</FONT> to be

the name of the key we're interested in.<BR>

Call the <I><FONT FACE="MCPdigital-I">openKey()</FONT> method,

<FONT FACE="MCPdigital-I">$handle</FONT> will hold the object

refereNCe.<BR>

Call the <I><FONT FACE="MCPdigital-I">getValue()</FONT> method.

The argument to <FONT FACE="MCPdigital-I">getValue()</FONT> is

the name of the value to be retrieved. In this instaNCe, the default

value is sought.<BR>

Print the data associated with the default value.</I></I></I></I></I>

</BLOCKQUOTE>

<BLOCKQUOTE>

<PRE>

use DmmReg;

use strict;



my($handle);

my($keyName) = 'SOFTWARE\A Perl Test Script\Last Data File';

my($value)



$handle = HKEY_LOCAL_MACHINE-&gt;openKey($keyName);

$value  = ($handle-&gt;getValue(''))[1];

print(&quot;The data file was named $value\n&quot;);

</PRE>

</BLOCKQUOTE>

<P>

This program displays:

<BLOCKQUOTE>

<PRE>

The data file was named C:\TEST.DAT

</PRE>

</BLOCKQUOTE>

<P>

You may find the call to the <TT>getValue()</TT>

method to be a little confusing. Let's take a closer look at it:

<BLOCKQUOTE>

<PRE>

$data = ($handle-&gt;getValue(''))[1];

</PRE>

</BLOCKQUOTE>

<P>

The <TT>getValue()</TT> method returns

an array that holds the data type of the value and the value itself.

SiNCe you only need the value in this example, an array slice

was used. You place parentheses around the entire fuNCtion call

to ensure that the return value is evaluated in an array context.

Then, regular subscripting notation selects the second element

of the returned array. The second element is assigned to <TT>$value</TT>.

<P>

The <TT>DmmReg</TT> module is designed

to work with strings, the most popular type of data stored in

the Registry. While you can work with other data types, like binary

data, you'll need to look at more advaNCed books to find out how.

<H3><A NAME="SettingaKeysNameValuePairs">

Setting a Key's Name-Value Pairs</A></H3>

<P>

You've already seen how to set the value of the default name-value

pair by using the <TT>createKey() </TT>method.

In this section, you use the <TT>setValue()</TT>

method to explicitly set any name-value pair. Let's build on the

example shown in &quot;Creating a New Key.&quot; Perhaps, instead

of just saving one data file, you need to save more than one.

Maybe you have the names of a message file and a data file to

store. You can use the following script as a template:

<P>

<IMG SRC="pseudo.gif" tppabs="http://cheminf.nankai.edu.cn/~eb~/Perl%205%20By%20Example/pseudo.gif" BORDER=1 ALIGN=RIGHT><p>

<BLOCKQUOTE>

<I>Specify that this script will use the <FONT FACE="MCPdigital-I">DmmReg

</FONT>module.<BR>

Specify that strict variable checking should be done.<BR>

Declare the <I><FONT FACE="MCPdigital-I">$handle</FONT> and <FONT FACE="MCPdigital-I">$keyName</FONT>

variables to be local to the file.<BR>

Initialize <I><FONT FACE="MCPdigital-I">$keyName</FONT> to be

the name of the key we're interested in.<BR>

Call the <I><FONT FACE="MCPdigital-I">createKey()</FONT> method,

<FONT FACE="MCPdigital-I">$handle</FONT> will hold the object

refereNCe.<BR>

Call the <I><FONT FACE="MCPdigital-I">setValue()</FONT> method

oNCe for each name-value pair that needs to be stored.</I></I></I></I></I>

</BLOCKQUOTE>

<BLOCKQUOTE>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲风情在线资源站| 中文字幕亚洲在| 欧美美女黄视频| 欧美亚洲综合网| 欧美亚洲综合久久| 欧美高清精品3d| 欧美伦理视频网站| 欧美一区二区三区精品| 91精品国产91久久综合桃花| 538在线一区二区精品国产| 欧美日韩在线观看一区二区| 精品视频999| 日韩美女视频在线| 久久青草国产手机看片福利盒子 | 天堂一区二区在线| 亚洲小说春色综合另类电影| 五月激情六月综合| 久久机这里只有精品| 国产一区二区三区高清播放| 成人综合在线网站| 在线视频综合导航| 日韩精品专区在线| 国产精品免费视频一区| 亚洲中国最大av网站| 日韩中文字幕区一区有砖一区| 日韩高清在线一区| 国产a级毛片一区| 99久久99久久精品免费看蜜桃| 欧美性猛片aaaaaaa做受| 91麻豆精品国产91久久久| 精品少妇一区二区三区视频免付费| 久久人人97超碰com| 日韩久久一区二区| 韩日av一区二区| 99在线热播精品免费| 欧美一区二区三区电影| 国产精品丝袜一区| 婷婷国产在线综合| 99国产精品久久久久| 欧美一级久久久| 亚洲色图另类专区| 免费人成网站在线观看欧美高清| 成人一区二区在线观看| 欧美肥胖老妇做爰| 亚洲欧洲另类国产综合| 久久国产欧美日韩精品| 一本久久精品一区二区| 久久久影视传媒| 日韩高清在线一区| 欧洲中文字幕精品| 久久久精品国产免费观看同学| 亚洲一二三四区不卡| 成人av免费观看| 精品国产一区久久| 日韩高清国产一区在线| 91丨porny丨中文| 国产午夜精品福利| 美女被吸乳得到大胸91| 欧美羞羞免费网站| 1000精品久久久久久久久| 美女网站一区二区| 91精品欧美综合在线观看最新| 国产精品卡一卡二| 国产精品伊人色| 欧美精品一区二区三区四区| 日韩不卡一区二区| 欧美日韩激情一区二区三区| 一区二区三区日韩| 成人国产亚洲欧美成人综合网| 欧美精品一区二区蜜臀亚洲| 青青草成人在线观看| 欧美浪妇xxxx高跟鞋交| 亚洲午夜影视影院在线观看| 色久综合一二码| 亚洲精品ww久久久久久p站| www.色精品| 亚洲精品一二三| 欧美自拍偷拍一区| 一区二区三区欧美亚洲| 在线免费观看日韩欧美| 亚洲欧洲99久久| 色香蕉成人二区免费| 亚洲精品免费视频| 色嗨嗨av一区二区三区| 一区二区三区不卡视频在线观看| 91原创在线视频| 亚洲图片欧美一区| 在线播放欧美女士性生活| 日本vs亚洲vs韩国一区三区二区| 777xxx欧美| 激情欧美一区二区三区在线观看| 欧美精品一区二区在线播放| 高清不卡一区二区| 中文字幕一区二区视频| 色狠狠一区二区| 天堂va蜜桃一区二区三区 | 国产精品久久三| 不卡一区在线观看| 亚洲欧美国产三级| 7777精品伊人久久久大香线蕉 | 9i在线看片成人免费| 一区二区三区视频在线看| 67194成人在线观看| 日本美女一区二区三区视频| 久久精品视频网| 色素色在线综合| 美女脱光内衣内裤视频久久影院| 国产色一区二区| 日本精品裸体写真集在线观看| 日精品一区二区| 国产精品久久免费看| 欧美揉bbbbb揉bbbbb| 国产精品一区免费在线观看| 一区二区三区欧美亚洲| 精品欧美久久久| 在线免费一区三区| 国产激情偷乱视频一区二区三区| 亚洲欧美日韩系列| 久久网站最新地址| 欧美日韩国产色站一区二区三区| 国产精品538一区二区在线| 亚洲在线观看免费| 亚洲国产精品二十页| 欧美福利视频导航| 91欧美一区二区| 国产精品91一区二区| 日韩精品久久久久久| 一区在线观看视频| 国产午夜精品美女毛片视频| 91精品国产手机| 91麻豆自制传媒国产之光| 精品一区二区三区香蕉蜜桃| 午夜一区二区三区在线观看| 国产精品伦理在线| 久久综合网色—综合色88| 欧美精品日日鲁夜夜添| 91香蕉视频mp4| 国产成人av一区| 国产一二三精品| 蜜臀av一区二区在线免费观看| 亚洲另类在线制服丝袜| 国产日产欧美一区二区三区 | 色偷偷一区二区三区| 国产久卡久卡久卡久卡视频精品| 日本欧美在线观看| 午夜精品久久久久影视| 亚洲午夜精品在线| 午夜视频一区二区三区| 一区二区三区不卡视频| 亚洲小说春色综合另类电影| 一区二区不卡在线视频 午夜欧美不卡在| 久久午夜羞羞影院免费观看| 2021国产精品久久精品| 精品少妇一区二区| 国产亚洲精品福利| 久久亚洲精品国产精品紫薇| 久久久精品综合| 久久精品一级爱片| 国产精品亲子伦对白| 国产精品色一区二区三区| 国产精品天美传媒| 1024成人网| 亚洲午夜影视影院在线观看| 亚洲国产精品嫩草影院| 日韩成人一级大片| 久久 天天综合| 成人小视频免费观看| 欧美在线看片a免费观看| 欧美在线一二三| 日韩小视频在线观看专区| 久久亚洲二区三区| 国产精品对白交换视频| 亚洲一级片在线观看| 视频在线在亚洲| 国内成+人亚洲+欧美+综合在线| 狠狠色丁香婷婷综合久久片| 风间由美一区二区三区在线观看 | 久久精品亚洲国产奇米99| 日本一区二区三区免费乱视频| 国产日产精品一区| 亚洲激情成人在线| 精品一区二区免费| 色狠狠桃花综合| 欧美va日韩va| 日韩伦理av电影| 麻豆国产精品一区二区三区| 国产不卡在线播放| 69av一区二区三区| 亚洲丝袜制服诱惑| 精东粉嫩av免费一区二区三区| 高清国产一区二区| 欧美一区二区三区小说| 亚洲品质自拍视频| 精品一区二区在线看| 色狠狠色狠狠综合| 国产午夜三级一区二区三| 午夜精品免费在线| 99热这里都是精品| 精品不卡在线视频| 香蕉成人伊视频在线观看|