Jump to content




[Question] How do you make config files?


  • You cannot reply to this topic
2 replies to this topic

#1 AnthonyD98™

  • Members
  • 193 posts
  • LocationAuckland, New Zealand

Posted 29 January 2013 - 01:08 PM

Hello I have a question:

How do you make config files?

How would you make a program that when you run for the first time ask's for you to enter a new username and a new password and then it saves that to a config file.
Then when you start the Program up for a 2nd time it ask's you for the a username and the password attached to that username.

Could someone help me with this?

Thanks, AnthonyD98

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 29 January 2013 - 01:29 PM

haha inspiration from anywhere? :blink: :P

a 'config' file is just a standard file. use fs.exists to see if its there, if not you can assume its first startup and ask for details and write to them to the file. when the file does exist read the file and proceed from there.

#3 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

Posted 29 January 2013 - 01:56 PM

for passwords you should really just save the hashed version of the password instead of the password itself

prevents people from just reading the config file and typing in the password





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users