呼唤远方
1.加密需要调用Aspnet_regiis.exe打开VS命令提示,然后输入:aspnet_regiis -pe "connectionStrings" -app "/SampleApplication" -prov "RsaProtectedConfigurationProvider"2.在类中调用连接字符串:var connStr=System.Configuration.ConfigurationManager.ConnectionStrings["name"].ConnectionString;