Web/Admin/Email/EmailAdmin.aspx.cs

(完整代码) 1KB

using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;

namespace Web.Admin.Email
{
    public partial class EmailAdmin : Web.UI.ManagePage
    {
        private BLL.Email bll = new BLL.Email();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                chkLoginLevel("viewEmail");
                txtServer.Text = email.SMTP;
                txtServerDk.Text = email.POST;
                txtEmail.Text = email.USER;
                txtPwd.Text = email.PASS;
                cbl_ssl.SelectedValue = email.SSL;
            }
        }

        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            chkLoginLevel("EditEmail");
            try
            {
                Model.Email model = new Model.Email();
                string UserPwd = txtPwd.Text.Trim();
                model.SMTP = txtServer.Text.Trim();
                model.POST = txtServerDk.Text.Trim();
                model.USER = txtEmail.Text.Trim();
                if (UserPwd != null && UserPwd != "")
                {
                    model.PASS = Common.DESEncrypt.Encrypt(UserPwd);
                }
                else
                {
                    model.PASS = email.PASS;
                }
                model.SSL = cbl_ssl.SelectedValue;
                bll.saveConifg(model, Utils.GetXmlMapPath("Emailpath"));
                JscriptPrint("邮件设置成功啦!", "EmailAdmin.aspx", "Success");
            }
            catch
            {
                JscriptMsg(350, 280, "错误提示", "<b>文件写入失败!</b>请检查是否有写入权限,如果没有,请联系管理员开启写入该文件的权限!", "EmailAdmin.aspx", "Error");
            }
        }

    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。