c# - Save user input -


this question has answer here:

so basically, have openfiledialog working displays chosen dir in textbox. i'm wondering how save users input when restart application stay in textbox? wouldn't have on every time. understand might stupid question, i've been googeling time , found nothing this. thanks.

public form1()     {         initializecomponent();         if(file.exists(@"path.txt"))             textbox1.text = file.readalltext(@"path.txt");     }      private void button1_click(object sender, eventargs e)     {         if(file.exists(@"path.txt") == false)             file.create(@"path.txt");         file.writealltext(@"path.txt", textbox1.text);     } 

just write in file, don't forget include system.io in references.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -