BlogEngine.Web/contact.aspx.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
#region Using
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using BlogEngine.Core;
using BlogEngine.Core.Web.Controls;
using System.Net.Mail;
using System.Text.RegularExpressions;
#endregion
public partial class contact : BlogBasePage, ICallbackEventHandler
{
private static readonly Regex _Regex = new Regex("<[^>]*>", RegexOptions.Compiled);
/// <summary>
/// Handles the Load event of the Page control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.GetCallbackEventReference(this, "arg", "callback", "context");
btnSend.Click += new EventHandler(btnSend_Click);
if (!Page.IsPostBack)
{
txtSubject.Text = Request.QueryString["subject"];
txtName.Text = Request.QueryString["name"];
txtEmail.Text = Request.QueryString["email"];
GetCookie();
phAttachment.Visible = BlogSettings.Instance.EnableContactAttachments;
InititializeCaptcha();
SetFocus();
}
Page.Title = Server.HtmlEncode(Resources.labels.contact);
base.AddMetaTag("description", _Regex.Replace(BlogSettings.Instance.ContactFormMessage, string.Empty));
}
/// <summary>
/// Sets the focus on the first empty textbox.
/// </summary>
private void SetFocus()
{
if (string.IsNullOrEmpty(Request.QueryString["name"]) && txtName.Text == string.Empty)
{
txtName.Focus();
}
else if (string.IsNullOrEmpty(Request.QueryString["email"]) && txtEmail.Text == string.Empty)
{
txtEmail.Focus();
}
else if (string.IsNullOrEmpty(Request.QueryString["subject"]))
{
后面还有 200 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
