简体   繁体   English

将用户名和密码存储在文件中,而不是在C中使用数据库

[英]store user name and password in a file instead of using database in C

I am purely a beginner to programming. 我纯粹是编程的初学者。 I want to store user name and password in a file ( Let's say XML or any other ). 我想将用户名和密码存储在一个文件中(假设是XML或其他任何文件)。 I will need to use that file for storing user name and password for authentication of my website instead of using database. 我将需要使用该文件来存储用于验证我的网站的用户名和密码,而不是使用数据库。 Can anyone advise me what type of file should i use and provide link if any such codes? 谁能告诉我应该使用哪种类型的文件并提供链接(如果有这样的代码)? Please take in mind that I have to do it in C language. 请记住,我必须使用C语言。 Thanks in advance! 提前致谢!

This sounds like a home work question so let me give you some ideas. 这听起来像是一个家庭作业问题,所以让我给您一些想法。 Also storing a user name and a password in a file in clear text is a bad idea. 另外,将用户名和密码以明文形式存储在文件中也是一个坏主意。

you can use the folowing std lib function to do what you need 您可以使用以下std lib函数执行所需的操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM