有没有办法在没有数据库的情况下存储信息?

发布于 2024-09-02 20:34:31 字数 174 浏览 4 评论 0 原文

你好,我想知道有没有什么方法可以存储数据,比如我想制作一个登录表单并保存用户名和密码,而不使用数据库或 .txt 文件?对于一些简单的事情来说,设置这样的东西似乎需要做很多工作,我只是想知道是否还有其他方法。 :)

如果有人有一些关于如何使用数据库 Access/Sql/Local Database 的教程,请发布。

HI, I was wondering is there any way to store data, like say I wanted to make a login form and save the usernames and passwords, without using a database or .txt file? Seems like alot of work to set up stuff like that, for something simple, and I was just wondering if there was another way. :)

And if any one has some tutorials on how to use a database Access/Sql/Local Database please post.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

长亭外,古道边 2024-09-09 20:34:31

对我来说,这是设置的工作。

For me this is a job for Settings.

谜兔 2024-09-09 20:34:31

你必须把它放在某个地方来保存它,我不确定文本文件是如何“大量工作”的,特别是与数据库相比。由于您使用了 c# 标记,我想您可以根据需要将其放入注册表中,这不需要在磁盘上创建任何新文件。

You have to put it somewhere to persist it, and I'm not sure how a text file is "a lot of work", especially when compared to a database. Since you used the c# tag, I guess you could put it in the registry if you want, which doesn't require making any new files on the disk.

ˇ宁静的妩媚 2024-09-09 20:34:31

从您对 JC 的评论来看,听起来您在谈论持久性,这是保存对象状态以供以后运行的想法。 (我认为提到登录让每个人都感到困惑)。我不是一个 C# 黑客,但是一些快速的谷歌搜索出现了 这个

听起来您可能正在专门寻找应用程序设置,教程此处

From your comment to JC, it sounds like you're talking about persistence, which is the idea of saving the state of an object for a latter run. (Mentioning logins threw everyone off, I think). I'm not much of a C# hacker, but some quick googling turned up this.

It sounded like you might be looking for application settings specifically, tutorial here.

多像笑话 2024-09-09 20:34:31

如果你想扩展,我会使用数据库。读取一个非常大的文本文件可能会很昂贵,而且我个人更喜欢在这种情况下使用数据库。

以下是教程的链接:http://msdn。 microsoft.com/en-us/library/ms247257(VS.80).aspx

安全方面,两者都可以工作,您可以对两者进行加密,但是能够逐行加密/解密,而无需一大堆额外的操作代码很好。

If you want to scale, I would use a database. A really large text file can be expensive to read in all the time, and I just personally like using databases more for situations like this.

Here's a link to a tutorial: http://msdn.microsoft.com/en-us/library/ms247257(VS.80).aspx

Security wise, both will work, you can encrypt both, however being able to encrypt/decrypt row by row without a whole bunch of extra code is nice.

贪恋 2024-09-09 20:34:31

你的问题令人困惑。听起来几乎就像您在问如何在不保存数据的情况下保存数据。

也许您只是不想使用完整的 RDBMS,例如 SQL Server 或 Oracle 甚至 SQL Server Express?然后是SQL Lite

Your question is confusing. Sounds almost like you're asking how to save the data without saving the data.

Maybe you're just not wanting to use a full RDBMS like SQL Server or Oracle or even SQL Server Express? Then there's SQL Lite

梅窗月明清似水 2024-09-09 20:34:31

数据库比文本文件要好得多,尤其是当您组织良好时。例如,拥有一个包含用户名和密码列的数据库表[即:

 +------------+------------+
 + Username   + Password   +
 +------------+------------+
 + Blargh     + Badajaja   +
 + Trinkle    + GALUMPADA  +
 +-------------------------+


更清晰
6Blargh8Badajaja7Trinkle9GALUMPADA

Blargh^]Badajaja^]Trinkle^]GALUMPADA

使用 C# 可以轻松使用 MySQL,只需使用 google 即可找到大量指南/教程。

Databases are way better than text files, especially when you're well-organized. For example, having a database table with Username and Password columns [ie:

 +------------+------------+
 + Username   + Password   +
 +------------+------------+
 + Blargh     + Badajaja   +
 + Trinkle    + GALUMPADA  +
 +-------------------------+

is much more legible than
6Blargh8Badajaja7Trinkle9GALUMPADA
or
Blargh^]Badajaja^]Trinkle^]GALUMPADA

MySQL is easy to work with using C#, just use google to find a ton of guides/tutorials.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文