Quote:
Basically I need to Save login and password in clear text in a text file.
Never store passwords in clear text - it is a major security risk. There is some information on how to do it here:
Password Storage: How to do it.[
^]
And remember: if this is web based and you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and store them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that.
Secondly, why is it giving you difficulties?
There are loads of ways to store info in a file, ranging from .INI files, .CONFIG files, "straight text" files, through to JSON, XML, CSV, and right up to multiuser databases, and the "right solution" depends on exactly what you have available and what you are going to do with the data. This may explain some of that:
That's not a database, dude![
^]
But if all you want is a text file, then use one:
File.WriteAllText[
^] needs only a path to the file, and a string to write, and reading back is just as simple.
So sit down, read the links, and think about exactly what you need to do with your data. The actual implementation is trivial!