开发者

Writing away a psw field value into .xml (md5)

I have a textbox with textmode :password. But after the postback the value disapears.

How can i retrieve this string value as simple as possible together with a very basic encryption?

R开发者_StackOverflow社区egards.


You are not very clear about how do you expect to “retrieve this string value”. If you want to retrieve the password entered by the user on the server (on the ASP.NET/C# side), you just read the Text property of the textbox.

As you write, after a postback, the page returned from the server has all password inputs cleared – the password text is not rendered back into the HTML page. That is a feature of ASP.NET’s TextBox (even though you might argue it is a misfeature). You might overcome this limitation by writing your own descendant of TextBox, or using a workaround. However, I don’t see how that is relevant to “retrieving this string value”, you don’t need to send the value back to client, do you?

As for encryption, you probably could use some JavaScript-based encryption to protect passwords in transit, or JavaScript-based hashing to compute just an MD5 of the password, there are some libraries available to do that, however, switching to https would probably be a better solution.

Also, I don’t understand the mention of .xml. Maybe you could add a little bit more detail on what you are trying to achieve?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜