http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 11180|回复: 6

[JS] JavascriptHelp

[复制链接]
发表于 2012-7-24 12:49:48 | 显示全部楼层 |阅读模式
导读部分
-------------------------------------------------------------------------------------------------------------
C#基类|C#自定义类|C#帮助类--系列导航文章
http://www.sufeinet.com/thread-655-1-1.html

以后会不断更新,谢谢大家
[C#] 纯文本查看 复制代码
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// 开发人:苏飞
/// 开发时间:2009-09-02
/// 主要功能:JavaScript弹出对话框以及跳转
/// </summary>
namespace BaseFunction
{
    public class JavascriptHelp
    {
        public JavascriptHelp()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        public static void Create()
        {
            System.Web.HttpContext.Current.Response.Write("<SCRIPT type=\"text/javascript\">");
        }

        public static void Dispose()
        {
            System.Web.HttpContext.Current.Response.Write("</SCRIPT>");
        }
        /// <summary>
        /// 显示对话框
        /// </summary>
        /// <param name="strMsg">显示信息</param>
        public static void GoTo(string strMsg, string strPath)
        {
            Create();
            if ((strPath == "") || (strPath == null))
            {
                System.Web.HttpContext.Current.Response.Write("  alert(\"" + strMsg + "\");history.go(-1);");
            }
            else
            {
                System.Web.HttpContext.Current.Response.Write("alert('" + strMsg + "');location.href='" + strPath + "';");
            }
            Dispose();
            System.Web.HttpContext.Current.Response.End();
        }
        public static void Alert(string msg)
        {
            Create();
            HttpContext.Current.Response.Write("alert('" + msg + "');");
            Dispose();
        }
        /// <summary>
        /// 打开一个新的网页,但不能设置网面的长宽
        /// </summary>
        /// <param name="strUrl">地址</param>
        /// <param name="strPara">页面参数</param>
        public static void OpenNewWindow(string strUrl, int width, int height)
        {
            Create();
            HttpContext.Current.Response.Write("var l=(window.screen.width/2)-" + width + "/2;");
            HttpContext.Current.Response.Write("var t=(window.screen.height/2)-" + height + "/2;");
            HttpContext.Current.Response.Write("window.open(url,'NewWindow','width='" + width + "',height='" + height + "',top='+t+',left='+l+',menubar=no,toobar=no,scrollbars=yes,resizable=no,status=no,loation=no');");
            Dispose();
        }
        /// <summary>
        /// 重新定向到一个文件
        /// </summary>
        /// <param name="strUrl">重新指定路径</param>
        public static void Redirect(string strUrl)
        {
            Create();
            System.Web.HttpContext.Current.Response.Write("window.location.href='" + strUrl + "';");
            Dispose();
        }
    }
}


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2012-7-24 15:14:43 | 显示全部楼层
好不错,真的不错
发表于 2012-11-4 14:24:15 | 显示全部楼层
嗯,很不错
发表于 2012-11-17 23:52:32 | 显示全部楼层
这个很给力,谢谢飞哥分享!
发表于 2012-12-7 16:10:26 | 显示全部楼层
我是来抄袭的。。。
发表于 2013-6-16 11:04:43 | 显示全部楼层
很好,
回复

使用道具 举报

发表于 2014-10-11 10:16:15 | 显示全部楼层
感谢分享!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-4-24 11:23

© 2014-2021

快速回复 返回顶部 返回列表