<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<forms name=".MyCookie" loginUrl="admin/login.aspx" protection="All" timeout="30" path="/" >
<credentials passwordFormat="Clear">
<user name="admin" password="demo"></user>
</system.web>
<appSettings>
<add key="ConnectionString" value="server=(local)///sqlserver;uid=sa;pwd=******;database=SoftDonw" />
//</appSettings>
//</configuration>
在引用中增加
using System.Configuration;
using System.Security
引用格式为
SqlConnection con=new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);