在.Net 1.x当中,使用Microsoft.Win32.RegistryKey类的GetValue方法读取注册表数据时,其实数据都是经过“处理”的;
例如,某个字符串数据本来的值是
%SystemRoot%\System32\IoLogMsg.dll
但是用GetValue方法得到的数据却是
C:\WINDOWS\System32\IoLogMsg.dll
也就是说,在读取注册表中的字符串时,系统会自作主张地替你展开环境变量。
这的确省去我们调用Environment.ExpandEnvironmentVariables方法的麻烦,但是反过来,当我们希望原封不动地拷贝一个注册表的字符串时则束手无策。
在.Net2.0当中,我们惊喜地发现Microsoft.Win32.RegistryKey类有了一个小小的改动,就是其GetValue方法增添了一个新的重载:
public Object GetValue (
string name,
Object defaultValue,
RegistryValueOptions options
)该方法的第三个参数是一个枚举,目前只有一个有用的值就是DoNotExpandEnvironmentNames。
指定该值,GetValue得到的结果就是没有经过展开的数据了。
http://smalldust.cnblogs.com/archive/2006/06/26/436164.html
转自:动态网站制作指南 | www.knowsky.com
mce tv philips 7135 cardbus tv tunerhdmi cable ps3 walmartboost mobile unlimited commerciallatest hdd camcorderparallel to usb cable driversdelete tunnel adapter vistahp usb driverscreate windows recovery console cdparallel port to usb cablewii dellclear high speed internet reviewsnetwork interface cards itemnetwork test softwarecoin pearl earringsrealtek rtl8169 gigabit ethernetmotorcycle tool kitportable dlp projectorsdish network connectionbelden audio cableselectrical single line diagram ebook3d wallpaper128mb video card downloadusb mains plugrj 45 color schemeshaw cable radio station guiderazer lycosa mirror reviewcoupon hp monitorhard drive enclosurescanon memory cardshelp me buy a computerinternet tv companycanon cnetinsignia usb driversusb flash drive 16gblan network cable testerelectric cable protectorpeachtree audio nova hybrid integrated ampac adapter dell computerpci e soundcardstv tuner philips 7130 driver productsusb bsm bus controller device driverpanasonic hdmi dvd playersmall clock radiocard access systeminstall sony head unit1080p plasma tvsusb scsi converterwii component cable not workingethernet switch tester
Replica lv Hangbags
Hangbags
replica handbags
replica handbags
replica handbags
replica handbags
handbags
replica handbags replica handbags replica handbags replica handbags replica handbags
usb cable
usb cable
usb cable
usb flash drives
usb flash drives usb flash drives usb flash drives usb flash drives USB Connector USB Connector USB Connector USB Connector USB Connector USB Connector