guestbook.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;

using EnterpriseNET.BusinessLogicLayer;
using EnterpriseNET.DataAccessHelper;

public partial class guestbook : System.Web.UI.Page
{
    public string mailContent;

    protected void Page_Load(object sender, EventArgs e)
    {
        Session["MUID"] = 6;
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        //利用session验证
        if (String.Compare(Session["CheckCode"].ToString(), this.ValidaCode.Text, true) == 0)
        {
            Hashtable ht = new Hashtable();
            ht.Add("GuestName", SqlStringConstructor.GetQuotedString(GuestName.Text));
            ht.Add("GuestPosition", SqlStringConstructor.GetQuotedString(GuestPosition.Text));
            ht.Add("Sex", SqlStringConstructor.GetQuotedString(Sex.Text));
            ht.Add("CompanyName", SqlStringConstructor.GetQuotedString(CompanyName.Text));
            ht.Add("Tel", SqlStringConstructor.GetQuotedString(Tel.Text));
            ht.Add("Email", SqlStringConstructor.GetQuotedString(Email.Text));
            ht.Add("WebSite", SqlStringConstructor.GetQuotedString(WebSite.Text));
            ht.Add("GuestContent", SqlStringConstructor.GetQuotedString(GuestContent.Text));

            Guestbook guestbook = new Guestbook();
            guestbook.Add(ht);

            Sendmail();

            Response.Redirect("guestbook_prs.aspx");
        }
        else
        {
            //Response.Write("<Script Language=JavaScript>alert(\"验证码输入错误!\")</Script>");
            this.ShowTipMessage.Text = "&nbsp;&nbsp;验证码输入错误,请重新输入验证码!";
        }
    }

    public MailMessage InitMail(string Address)
    {
        mailContent = "姓名:" + this.GuestName.Text + "<br />职位:" + this.GuestPosition.Text + "<br />性别:" + this.Sex.SelectedValue + "<br />公司名称:" + this.CompanyName.Text;
        mailContent = mailContent + "<br />联系电话:" + this.Tel.Text + "<br />电子邮箱:" + this.Email.Text + "<br />网址:" + this.WebSite.Text + "<br />留言内容:" + this.GuestContent.Text;

后面还有 32 行代码,解锁后查看完整代码

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

AI 解读

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

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