From http://hi.baidu.com/%D0%C7%B7%C9%D4%C2%C2%E4/home
"
< Configuration >
< Appsettings >
< Add key = " Myconfig " Value = " Data Source =.; initial catalog = xbmis; user id = sa; Pwd =: " />
< Add key = " Crystaliamgecleaner-autostart " Value = " True " />
< Add key = " Crystalimagecleaner-sleep " Value = " 6000 " />
< Add key = " Crystalimagecleaner-age " Value = " 120000 " />
</ Appsettings >
< Connectionstrings >
< Add name = " Xbmisconnectionstring " Connectionstring = " Data Source =.; initial catalog = xbmis; persist Security info = true; user id = sa; Password = "
Providername = " System. Data. sqlclient " />
< Connectionstrings >
InProgramCentralized reference is as follows:
Use the namespace system. configuration, that is, using system. Configuration
System. configuration. configurationmanager. configurettings [ " Myconfig " ]
Get Data Source = .; Initial catalog = Xbmis; User ID = SA; pwd = :
System. configuration. configurationmanager. connectionstrings [ " Xbmisconnectionstring " ]. Connectionstring
Get Data Source = .; Initial catalog = Xbmis; persist Security info = True; User ID = SA; Password = "
Providername = " System. Data. sqlclient
Note: The underlined part after the namespace system. configuration is referenced can be omitted.
<Etettings> is generally used to configure common values <connectionstrings>. It is generally used to configure database connections.
Not mandatory. You can write an XML file for configuration.
It is convenient here.
"
"
<Appsettings> is generally used to configure common values.
<Connectionstrings>
Used to configure database connections
Not mandatory. You can write an XML file for configuration.
It is convenient here.
"