Need Help For Writing Configuration/INI/Store/Remember/Note default files

Hello, everyone~~=]
I met difficulties in writing your own scripts.
I want some parameters in the current operation in my script can be recorded to a *configuration *file.
Such as recording output paths I set, the CheckBox checked state set, or the Value of a parameter fill out ,can be record to the configuration file automatic When I close the MAX or script dialog.
It still can be read from the configuration file to my preferences In next time I restart MAX or script dialog.
Please teach me how to write this code.

I am very grateful here. --<@@@~~~