如何操作注册表
来源:互联网 发布:sjf调度算法 编辑:程序博客网 时间:2024/06/05 21:55
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
RegistryKey regWrite;
//往HKEY_CURRENT_USER主键里的Software子键下写一个名为“Test”的子键
//如果Test子键已经存在系统会自动覆盖它
regWrite = Registry.CurrentUser.CreateSubKey("Software//Test");
//往Test子键里添两条数据项,一条名为"Name",另一条名为"Sex"
//值分别是"luolie","男"
regWrite.SetValue("Name","luolie");
regWrite.SetValue("Sex","男");
//关闭该对象
regWrite.Close();
读注册表
RegistryKey regRead;
//读取HKEY_CURRENT_USER主键里的Software子键下名为“Test”的子键
regRead= Registry.CurrentUser.OpenSubKey("Software//Test",true);
if(regRead==null) //如果该子键不存在
{
MessageBox.Show("No Data!");
}
else
{
object obj= regRead.GetValue("Name"); //读取“Name”项的值
textBox1.Text = obj.ToString(); //显示在TextBox里
}
//关闭该对象
oRe
操作注册表';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
//写注册表 RegistryKey regWrite;
//往HKEY_CURRENT_USER主键里的Software子键下写一个名为“Test”的子键
//如果Test子键已经存在系统会自动覆盖它
regWrite = Registry.CurrentUser.CreateSubKey("Software//Test");
//往Test子键里添两条数据项,一条名为"Name",另一条名为"Sex"
//值分别是"luolie","男"
regWrite.SetValue("Name","luolie");
regWrite.SetValue("Sex","男");
//关闭该对象
regWrite.Close();
读注册表
RegistryKey regRead;
//读取HKEY_CURRENT_USER主键里的Software子键下名为“Test”的子键
regRead= Registry.CurrentUser.OpenSubKey("Software//Test",true);
if(regRead==null) //如果该子键不存在
{
MessageBox.Show("No Data!");
}
else
{
object obj= regRead.GetValue("Name"); //读取“Name”项的值
textBox1.Text = obj.ToString(); //显示在TextBox里
}
//关闭该对象
oRe
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 如何操作注册表
- Java如何操作注册表
- 如何在C#中轻松操作注册表
- 如何在C#中轻松操作注册表
- ASP.NET中如何操作注册表
- 如何在C#中轻松操作注册表
- 如何在C#中轻松操作注册表
- C#注册表是如何操作的
- 如何使用.REG文件来操作注册表
- 操作注册表
- 注册表操作
- 注册表操作
- 操作注册表
- 注册表操作
- 注册表操作
- 注册表操作
- 注册表操作
- 注册表操作
- C#处理鼠标和键盘事件
- 一个个人网页自动化生成系统(5)
- DPC:Creating a DataBound List of Radio Buttons--PA
- 转: ASP.NET高级应用 (3)
- 一个个人网页自动化生成系统(3)
- 如何操作注册表
- 桌面中心(三) 修改数据库
- dpc:Creating a DataBound List of Radio Buttons--预览
- 桌面中心(二) 数据库写入
- 在 Visual C# .NET 中建立一个平滑的进度条
- 桌面中心(一) 创建数据库
- DPC: Creating a multicolumn Dropdownlist[等级:初 中]
- PHP 留言簿(带Oracle数据库分页的显示功能)
- C#如何打开关闭CDROM