这些都是针对注册表的写和读的操作。
给你一个操作注册表的例子(我自己写的):
private string GetCurrentComputerName()//测试成功
{

string sLocal; //本机计算机名
//记住必须使用Registry.LocalMachine.OpenSubKey()成员函数来初始化变量
RegistryKey regLocal=Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName");
sLocal=regLocal.GetValue("ComputerName").ToString();
regLocal.Close();
sLocal=sLocal.Trim();//记住去掉可能的空格
return sLocal; }

解决方案 »

  1.   

    //重新处理一下格式,csdn给的宽度不够
    private string GetCurrentComputerName()//测试成功
    {

             string sLocal; //本机计算机名
             //记住必须使用Registry.LocalMachine.OpenSubKey()成员函数来初始化变量
    RegistryKey regLocal=Registry.LocalMachine.OpenSubKey _
    (@"SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName");
    sLocal=regLocal.GetValue("ComputerName").ToString();
    regLocal.Close();
    sLocal=sLocal.Trim();//记住去掉可能的空格
    return sLocal;}
      

  2.   

    楼上的,要看你用什么安装程序了,不同的安装程序有不同的脚本,需要根据特定的安装程序(安装制作软件)特殊对待,然后把用户信息写入注册表,在自己的应用程序中读取就可了。
    建议采用:installSheild或Wise for .net他们的功能都很强大,比vs.net中的要强大的多。
      

  3.   

    To gordenfl (可爱):Visual Studio.NET所带的Setup Project可以帮您将您的.NET应用程序打包成msi安装程序。以下是如何在安装程序中增加让用户输入个人信息和注册码的方法,以及如何编程获取这些数据的方法。[如何在MSI安装程序中让用户输入个人信息和注册码]
    1)创建项目:在“New Project”对话框中选择“Setup and Deployment Projects”中的Setup Project。
    2)添加文件:
       a)项目创建好以后,右击项目根节点,在弹出菜单中选择“View->File System”
       b)在弹出的“File System”窗口中,右击Application Folder,选择“Add->Files…”,添加你的exe、dll文件及其他资源文件。
    3)添加Customer Information对话框:
       a)右击项目根节点,在弹出菜单中选择“View->User Interface”
       b)在弹出的“User Interface”窗口中,右击“Install->Start”,在弹出菜单中选择“Add Dialog”
       c)在弹出的“Add Dialog”窗口中,选择Customer Information。
    做到这一步,安装程序运行时就会出现界面提示用户输入Name、Organization以及Serial Number。[如何将编程读取用户输入的个人信息和注册码]
    以上三项数据在整个安装committed以后会被一直存放到注册表的HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData键值下,你可以根据ProductCode搜索您自己的产品所在的子键。这里的ProductCode可以在安装项目的项目属性中查看,是一个GUID。Name、Organization以及Serial Number分别存放在RegOwner、RegCompany和ProductID中,直接读取即可。另外,您也可以在安装未结束时即读取这些信息。具体的做法请参考MSDN中对System.Configuration.Install.Installer类的相关说明。
    - 微软全球技术中心 VC技术支持本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
    为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。