通常的,为了布置到服务器后修改的方便通常把一些会改变的值放在webconfig:
首先在web.ocnfig中放入如下值
<appSettings>
<add key="AccountName" value="info@auroraoztravel.com"/>
<add key="ToAddress" value="615297444@qq.com"/>
</appSettings>
然后在.cs层引用using System.Configuration;
接下来使用
request.AccountName = ConfigurationManager.AppSettings["AccountName"];
request.ToAddress = ConfigurationManager.AppSettings["ToAddress"];