C# How to set and read controls settings from a text document Win Forms -


i need store few hotkeys , settings user can pick in text document or alternative when user reset's application changes wont reset default. need access different classes , controls couple classes. how can ?

you can use app.config file.

your main code:

using system.configuration;  public class whateverclassname {      string setting1 = configurationmanager.appsettings["setting1"];      // of code } 

then in app.config file:

    <?xml version="1.0"?>     <configuration>       <appsettings>         <add key="setting1" value="whatever setting value is"/>       </appsettings>       <startup>       <supportedruntime version="v4.0" sku=".netframework,version=v4.5.1"/>       </startup>     </configuration> 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -