⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getwindows.cs

📁 这是asp.net^和Visual C++Sharp编写的串并口通讯的书籍 源代码
💻 CS
字号:
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>
/// 返回窗口控件
/// </summary>
public static class GetWindows
{
    /// <summary>        
    /// 函数名:GotoParentWindow    
    /// 功能描述:返回父窗口    
    /// </summary>
    /// <param name="parentWindowUrl">父窗口</param>        
    public static void GotoParentWindow(string parentWindowUrl)
    {
        string js = @"<Script language='JavaScript'>
                    this.parent.location.replace('" + parentWindowUrl + "');</Script>";
        HttpContext.Current.Response.Write(js);
    }

    /// <summary>
    /// 打开窗口
    /// </summary>
    /// <param name="url"></param>
    public static void OpenWebForm(string url)
    {
        /*…………………………………………………………………………………………*/
        /*修改目的:    新开页面去掉ie的菜单。。。                        */

        string js = @"<Script language='JavaScript'>
            //window.open('" + url + @"');
            window.open('" + url + @"','','height=170,width=630,top=0,left=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no,directories=no');
            </Script>";
        /*结束*/
        /*…………………………………………………………………………………………*/


        HttpContext.Current.Response.Write(js);
    }

    public static void OpenWebForm(string url, string name, string future)
    {
        string js = @"<Script language='JavaScript'>
                     window.open('" + url + @"','" + name + @"','" + future + @"')
                  </Script>";
        HttpContext.Current.Response.Write(js);
    }
    public static void OpenWebForm(string url, string formName)
    {
        /*…………………………………………………………………………………………*/
        /*修改目的:    新开页面去掉ie的菜单。。。                        */
        /*注释内容:                                */
        /*开始*/
        string js = @"<Script language='JavaScript'>
            window.open('" + url + @"','" + formName + @"','height=0,width=0,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no');
            </Script>";
        /*结束*/
        /*…………………………………………………………………………………………*/

        HttpContext.Current.Response.Write(js);
    }

    /// <summary>        
    /// 函数名:OpenWebForm    
    /// 功能描述:打开WEB窗口    
    /// </summary>
    /// <param name="url">WEB窗口</param>
    /// <param name="isFullScreen">是否全屏幕</param>
    public static void OpenWebForm(string url, bool isFullScreen)
    {
        string js = @"<Script language='JavaScript'>";
        if (isFullScreen)
        {
            js += "var iWidth = 0;";
            js += "var iHeight = 0;";
            js += "iWidth=window.screen.availWidth-10;";
            js += "iHeight=window.screen.availHeight-50;";
            js += "var szFeatures ='width=' + iWidth + ',height=' + iHeight + ',top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no';";
            js += "window.open('" + url + @"','',szFeatures);";
        }
        else
        {
            js += "window.open('" + url + @"','','height=0,width=0,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no');";
        }
        js += "</Script>";
        HttpContext.Current.Response.Write(js);
    }
    /// <summary>
    /// 关闭窗口
    /// </summary>
    public static void CloseWindow()
    {
        string js = @"<Script language='JavaScript'>
                        window.close();
                        </Script>";
        HttpContext.Current.Response.Write(js);
        HttpContext.Current.Response.End();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -