`

using C# modify app.config in the run time

    博客分类:
  • C#
 
阅读更多

今天在印度的网站上发现一个很经典的代码,也对比了国内的网站的答案

发现了,国内的技术含量真是太低了,心情也不好了

为什么印度人能做到那么有技术性,我们为什么不能,还是学习的不够啊,所以果断的拿到国内来,和大家分享

 

希望在国内,我们IT业能有新的蓝天

 

1.app.config国内大多是把它当作xml处理

(哥们,你那叫修改,而不是在run time的环境中,鄙视)

2.简要说明下,印度人的代码

2.1  You can change App.config file runtime using C# in your windows application

 你可以改变app.config文件当你的windows form运行的时候

下面是代码

// Open App.Config of executable
 System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// Add an Application Setting.
config.AppSettings.Settings.Remove("LastDateFeesChecked");
config.AppSettings.Settings.Add("LastDateFeesChecked", DateTime.Now.ToShortDateString());
// Save the configuration file.
config.Save(ConfigurationSaveMode.Modified);
// Force a reload of a changed section.
ConfigurationManager.RefreshSection("appSettings");

 不解释了,有注释

 

 

很好的代码,希望对大家有用

 

 

0
1
分享到:
评论

相关推荐

    modify_headers-0.7.1.1-fx.xpi

    profile.setPreference("modifyheaders.config.active", true); profile.setPreference("modifyheaders.config.alwaysOn", true); FirefoxBinary firefoxBinary = new FirefoxBinary(); //firefoxBinary....

    Using.the.Cplusplus.Standard.Template.Libraries.1484200055

    Using the C++ Standard Template Libraries is a contemporary treatment that teaches the generic programming capabilities that the C++ 14 Standard Library provides. In this book, author Ivor Horton ...

    u_index_modify.rar_In Time

    Output registers encode semantic information in their name. Need to lookup a table built at decl time.Input registers are referred to by their semantic name rather than by index. Use the mapping build...

    modify_config.zip

    modify_config.zip

    ASP.NET 4高级程序设计

    ASP.NET 4高级程序设计Many of the examples in this book use SQL Server. In most cases, it is assumed that you are using SQL Server Express. However, you can modify the connection string in the ...

    android-a programmer's guide

    Try This: Run the API Demos Sample Application . . . . . . . . . . . . . . . . . . . . . . . . . 41 Android Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    Android.for.the.BeagleBone.Black

    With a variety of example apps that demonstrate key hardware communication concepts, this book will help you become an Android hardware interfacing pro in no time. Table of Contents Chapter 1. ...

    BURNINTEST--硬件检测工具

    - A printer to run the printer test, set-up as the default printer in Windows. - A CD ROM + 1 Music CD or Data CD to run the CD test. - A CD-RW to run the CD burn test. - A network connection and the ...

    Professional Refactoring in C# & ASP.NET

    In this first book to provide a hands-on approach to refactoring in C# and ASP.NET, you’ll discover to apply refactoring techniques to manage and modify your code. Plus, you’ll learn how to build a...

    Android代码-VirtualApp

    中国人猛戳这里 About VirtualApp is an open platform for Android that allows you to ...You are not allowed to modify the app module and put to the software market, if you do that, The consequences you kno

    In-plan操作手册

    11. Add additional tools using control.bat 12. Review & update Matrix 13. Run MRP naming 14. Edit drills 15. Edit Order Spec 16. Run traveler 17. Compare Spec. 18. Update BOM 19. Check in Job ...

    Think.DSP.Digital.Signal.Processing.in.Python.1491938455_Early.Release

    By the end of the first chapter, you'll be able to decompose a sound into its harmonics, modify the harmonics, and generate new sounds. Subsequent chapters follow a logical progression that develops ...

    BatchMD5Modify1.0.rar

    我们在做游戏资源或者其他资源的时候,经常要用到加密。否则游戏资源包被破解之后游戏资源就公开可见了,所以需要用到这款MD5加密软件,非常的好用

    C# Game Programming Cookbook for Unity 3D - 2014

    1.1.3 Using the Singleton Pattern in Unity...........................5 1.1.4 Inheritance.................................................6 1.1.5 Where to Now?.............................................

    binset.v2.exe

    Modify the binary at 0 or 0x3000 binset.exe -f app.bin -s 0,0xff,0xff,0xff,0xff binset.exe -f app.bin -s 0x3000,0x55,0xaa,1,2,3,4 Modify and delete backups binset.exe -f app.bin -s 0,0xff,0xff,0...

    C# Design Patterns: A Tutorial

    Programmers use design patterns to organize objects in programs, making them easier to write and modify. C# Design Patterns: A Tutorial is a practical guide to writing C# programs using the most ...

    Android代码-termux-styling

    When developing (or packaging), note that this app needs to be signed with the same key as the main Termux app in order to have the permission to modify the required font or color files. License ...

    Using LUA with Visual C++ (Introduction)

    Or you can create scripts, encrypt them and then decrypt them at run-time so that only a number of limited people can script for your program. Allowing the end-user to modify your program, gives your...

    [精通正则表达式(第三版)].(美)佛瑞德.扫描版(modify).pdf

    [精通正则表达式(第三版)].(美)佛瑞德.扫描版(modify).pdf 中文版.

Global site tag (gtag.js) - Google Analytics