在文本框中保存值? [英] Saving values in a text box?

查看:67
本文介绍了在文本框中保存值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我想知道如何保存输入

文本框的最后一个字符串。我想在我的表格中的文本框中保存用户名或密码信息

,这样用户就不必不断地输入它们了!


谢谢!


Luis

Hello All!
I was wondering how I can go about saving the last string entered into a
textbox. I would like to save username or pwd info in textboxes in my forms
so that users don''t have to continually type them!

Thanks!

Luis

推荐答案

使用服务器文本框(System.Web.UI.WebControls.Textbox)。他们

自动做你想做的事。

" Anon" <一个** @ anon.com>在消息中写道

新闻:OL ************* @ tk2msftngp13.phx.gbl ...
Use server textboxes (System.Web.UI.WebControls.Textbox). They
automatically do what you want.
"Anon" <an**@anon.com> wrote in message
news:OL*************@tk2msftngp13.phx.gbl...
Hello All!
我想知道如何保存输入
文本框的最后一个字符串。我想在我的
表格中保存文本框中的用户名或密码信息,这样用户就不必不断地输入它们了!

谢谢!

Luis
Hello All!
I was wondering how I can go about saving the last string entered into a
textbox. I would like to save username or pwd info in textboxes in my forms so that users don''t have to continually type them!

Thanks!

Luis



Winform?有很多方法可以做到这一点。我正在创建一个类,其中包含

用户名并将其序列化到用户配置文件文件夹中的磁盘。


如果您需要代码,请给我发电子邮件


格雷格


Anon <一个** @ anon.com>在消息中写道

新闻:OL ************* @ tk2msftngp13.phx.gbl ...
Winform? Lots of ways to do this. I am creating a class that holds the
username and serializing it to disk in the user profile folder.

email me if you want the code

Greg

"Anon" <an**@anon.com> wrote in message
news:OL*************@tk2msftngp13.phx.gbl...
Hello All!
我想知道如何保存输入
文本框的最后一个字符串。我想在我的
表格中保存文本框中的用户名或密码信息,这样用户就不必不断地输入它们了!

谢谢!

Luis
Hello All!
I was wondering how I can go about saving the last string entered into a
textbox. I would like to save username or pwd info in textboxes in my forms so that users don''t have to continually type them!

Thanks!

Luis





" Anon" <一个** @ anon.com>在消息中写道

新闻:OL ************* @ tk2msftngp13.phx.gbl ...

"Anon" <an**@anon.com> wrote in message
news:OL*************@tk2msftngp13.phx.gbl...
Hello All!
我想知道如何保存输入
文本框的最后一个字符串。我想在我的
表格中保存文本框中的用户名或密码信息,这样用户就不必不断地输入它们了!

谢谢!

Luis
Hello All!
I was wondering how I can go about saving the last string entered into a
textbox. I would like to save username or pwd info in textboxes in my forms so that users don''t have to continually type them!

Thanks!

Luis




如果它是Windows窗体(桌面)应用程序,您可以将其保存到

注册表中。 />

对于任何类型的应用程序,您都可以将信息保存到数据库表中。如果

执行机器的权限允许,您也可以将其保存为

文件系统,如XML或文本。对于基于浏览器的应用程序,您可以使用存储在用户计算机上的cookie




这是一种非常糟糕的安全措施填写一个

密码字段(你可能只需要在显示器上粘贴一个带有信息的便利贴

)。 *永远不要*这样做。但是,对于使用cookie的基于浏览器的应用程序

,自动登录(不显示登录表单)是

常见做法。如果你这样做,请确保你加密密码所以它不能被访问计算机的人简单地读取。我建议

反对这样做,因为访问的数据是敏感的。


你真的应该向你的应用程序的用户解释一些额外的

他们必须输入登录的键击才能更好地保证安全性。如果他们抱怨b $ b,告诉他们那么他们就不应该为安全而烦恼而且只有

让任何人都敞开心扉,因为那基本上就是他们'
想要。


艾伦



If it''s a Windows Forms (desktop) application, you can save it to the
registry.

For any type of app, you can save the information to a database table. If
the permissions of the executing machine allow it, you can also save to the
filesystem as XML or text. For a browser-based app, you could use a cookie
stored on the user''s machine.

It is an extremely bad security practice to automatically populate a
password field (you might as well just stick a post-it note with the info on
the monitor). *NEVER* do this. However, in the case of a browser-based app
using a cookie, automatic login (without displaying the login form) is a
common practice. If you do this, be certain you encrypt the password so it
can''t be simply read by someone who gains access to the computer. I advise
against doing this where the data being accessed is sensitive.

You really should explain to the users of your app that the few extra
keystrokes they have to enter to login is far better for security. If they
complain, tell them then they shouldn''t bother with security at all and just
leave it wide open for anyone, since that''s essentially what they''re
wanting.

Alan


这篇关于在文本框中保存值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆