WebApp/JS.cs

(开头部分) 15KB

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

using System.Web;
using System.Web.Security;
using System.Web.UI.WebControls;
using System.Web.SessionState;
using System.Data;
using System.Text;

/// <summary>
/// 在开发过程中可以用的一些技巧文件
/// </summary>
namespace WebApp
{
    public class JS
    {
        protected static HttpResponse Response;
        protected static HttpSessionState Session;
        public JS()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        /// <summary>
        /// 弹出JavaScript小窗口,并转向指定的页面
        /// </summary>
        /// <param name="message">弹出信息</param>
        /// <param name="toURL">专转向的网页</param>
        public static void AlertAndRedirect(string message, string toURL)
        {
            string js = "<script language=javascript>alert('{0}');window.location.replace('{1}')</script>";
            HttpContext.Current.Response.Write(string.Format(js, message, toURL));
        }

        public static void GoRedirect(string toURL)
        {
            string js = "<script language=javascript>window.location.replace('{0}')</script>";
            HttpContext.Current.Response.Write(string.Format(js, toURL));
        }

        public static void ToRedirect(string toURL)
        {
            string js = "<script language=javascript>parent.location.replace('{0}')</script>";
            HttpContext.Current.Response.Write(string.Format(js, toURL));
        }
        public static void AlertAndRedirectParent(string message, string toURL)
        {
            string js = "<script language=javascript>alert('{0}');parent.location.replace('{1}')</script>";
            HttpContext.Current.Response.Write(string.Format(js, message, toURL));
        }
        /// <summary>
        /// 弹出JavaScript小窗口
        /// </summary>
        /// <param name="js">窗口信息</param>
        public static void Alert(string message)
        {
            message = StringUtil.DeleteUnVisibleChar(message);
            string js = @"<Script language='JavaScript'>
                    alert('" + message + "');</Script>";
            HttpContext.Current.Response.Write(js);
        }
后面还有 316 行代码,购买后查看完整代码

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

AI 解读 AI

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

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