实现很简单,直接上代码:
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
config.AppSettings.Settings["YY_ALLOW_AMOUNT"].Value = yyAllowAmount.ToString();
config.Save();
添加引用:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Web.dll
命名空间:
using System.Web.Configuration;