کتابخانهی Formo برای مدیریت فایلهای Config
نویسنده: وحید نصیری
تاریخ: ۱۳۹۴/۰۹/۲۸ ۱۰:۶
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
The settings
<appSettings>
<add key="RetryAttempts" value="5" />
<add key="ApplicationBuildDate" value="11/4/1999 6:23 AM" />
</appSettings>
The code
dynamic config = new Configuration();
var retryAttempts1 = config.RetryAttempts; // returns 5 as a string
var retryAttempts2 = config.RetryAttempts(10); // returns 5 if found in config, else 10
var retryAttempts3 = config.RetryAttempts(userInput, 10); // returns 5 if it exists in config, else userInput i