Working with Registry in C# 2.0 (Windows Forms)

前端 未结 7 1426
一个人的身影
一个人的身影 2020-12-19 20:17

I\'m a newbie to Windows Forms.

I\'m designing an Windows Application in .Net Framework 2.0 in which, I need to Store a UserName and Password somewhere in the Syst

7条回答
  •  暖寄归人
    2020-12-19 20:52

    You need to ask yourself a couple of questions:

    1. Should only one user be able to use the uid/password?

    2. How safe should the password be stored?

    It's quite easy to store information in the registry. http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx

    If you just want to store it for one user, store it under HKEY_CURRENT_USER/software/your_company/your_product otherwize store it under HKEY_LOCAL_MACHINE/software/your_company/your_product.

    If your password is to be stored safely, there are safer solutions than the registry.

提交回复
热议问题