lkcn
专注.NET开发, 移动平台
大家好啊,来BLOG四年多了,收获不算很大哦,呵呵
与我联系
发短消息
搜索
常用链接
我的随笔
我的空间
我的短信
我的评论
更多链接
我的文章
我的参与
我的新闻
最新评论
我的标签
留言簿
给我留言
查看留言
我的标签
Maxsder.exe
(1)
Hiber.exe
(1)
免疫及专杀
(1)
随笔分类
test
(rss)
随笔档案
(19)
2008年3月 (1)
2007年12月 (2)
2007年10月 (1)
2007年8月 (1)
2007年1月 (1)
2006年8月 (2)
2006年6月 (2)
2004年11月 (1)
2004年10月 (7)
2004年8月 (1)
相册
爸爸
获得本机电话号码
最新评论
阅读排行榜
1. Internet安全与数字签名(1553)
2. 转贴,C#菜单制作(1268)
3. 用Asp.Net来读写注册表 (795)
4. CSDN关于数字签名的问题 (783)
5. Maxsder.exe光驱病毒专杀工具(762)
评论排行榜
1. 没事学学DELPHI~(6)
2. Internet安全与数字签名(3)
3. 不要再用TD了(2)
4. IFRAME清除工具(2)
5. 用Asp.Net来读写注册表 (1)
Powered by:
博客园
模板提供:
沪江博客
博客园
|
首页
|
发新随笔
|
发新文章
|
联系
|
订阅
|
管理
用Asp.Net来读写注册表
向注册表读取一个键值:
1
RegistryKey rstryKey
=
Registry.LocalMachine;
2
RegistryKey rgstryKeyValues
=
rstryKey.OpenSubKey(
"
SOFTWARE\Microsoft\Windows\CurrentVersion
"
);
3
4
Response.Write(
"
ProductId =
"
+
rgstryKeyValues.GetValue(
"
ProductId
"
));
5
Response.Write(
""
);
6
7
Response.Write(
"
ProgramFilesDir =
"
+
rgstryKeyValues.GetValue(
"
ProgramFilesDir
"
));
8
Response.Write(
""
);
9
10
Response.Write(
"
ProgramFilesPath =
"
+
rgstryKeyValues.GetValue(
"
ProgramFilesPath
"
));
11
Response.Write(
""
);
12
13
Response.Write(
"
MediaPath =
"
+
rgstryKeyValues.GetValue(
"
MediaPath
"
));
14
Response.Write(
""
);
15
16
rgstryKeyValues.Close();
17
18
向注册表写入一个键值
1
rstryKey
=
Registry.CurrentUser;
2
rgstryKeyValues
=
rstryKey.OpenSubKey(
"
SOFTWARE
"
);
3
RegistryKey rgstrySetKey
=
rgstryKeyValues.CreateSubKey(
"
TestKeyDirectory
"
);
4
rgstrySetKey.SetValue(
"
Key1
"
,
"
Key1Value
"
);
5
rgstrySetKey.SetValue(
"
Key2
"
,
"
Key2Value
"
);
6
rgstrySetKey.SetValue(
"
Key3
"
,
3
);
发表于 2004-10-14 13:15
做想做的人,做想做的事
阅读(795)
评论(1)
编辑
收藏
网摘
评论
#1楼
回复
引用
查看
我的ASPNET没有权限,怎么办?
新用户注册
刷新评论列表
标题
姓名
主页
Email
(博主才能看到)
验证码
*
看不清,换一张
[
登录
][
注册
]
内容(请不要发表任何与政治相关的内容)
网站首页
新闻频道
社区
小组
博问
网摘
人才
找找看
Remember Me?
登录
使用高级评论
新用户注册
返回页首
恢复上次提交
[使用Ctrl+Enter键可以直接提交]
该文被作者在 2006-06-28 11:25 编辑过
Google站内搜索
China-pub 计算机图书网上专卖店!6.5万品种 2-8折!
近千种 9-95 新二手计算图书火热销售中!
相关文章:
相关链接:
最新IT新闻:
Silverlight 2 SDK中文版发布
[译稿]微软将 jQuery IntelliSense整合到Visual Studio
微软:不裁员也不削减研发开支
2008年11月22日科技博客精选
诺基亚将支持Lotus Notes 和黑莓争夺市场