C#: Ask User for a Password which is then stored in a SecureString

前端 未结 2 1116
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 05:18

In the small application that I\'m currently developing for a customer I need to ask the user for his windows login username, password and domain and then use those with

2条回答
  •  自闭症患者
    2021-02-09 06:07

    The reason the SecureString wants to accept one character at a time is that otherwise you would have the entire string before that and cause the string to be in memory. Thus, using a SecureString in this scenario kind of defeats the purpose.

提交回复
热议问题