惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cloudbric
Cloudbric
P
Palo Alto Networks Blog
T
Threatpost
T
Tor Project blog
T
Tenable Blog
AWS News Blog
AWS News Blog
Project Zero
Project Zero
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Latest
Security Latest
云风的 BLOG
云风的 BLOG
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
MongoDB | Blog
MongoDB | Blog
aimingoo的专栏
aimingoo的专栏
K
Kaspersky official blog
Jina AI
Jina AI
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
IT之家
IT之家
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
Y
Y Combinator Blog

博客园 - 10cn.net

expdp/impdp 远程DB访问(跨服务器创建DB连接) DIV居中(水平&垂直) PHPMailer&Gmail FOR vROW_CUR IN vCUR(PARA1, PARA2) LOOP の使い方 JavaScript Trim Oracle中复制表结构和表数据 Excel 列号转换为字母(VBA) Excel列字母与数字的转换 VS在进行调试时,不能调试的原因列举如下 Create User OS中9个是危险较大的服务 .Net开发人员应该下载的十种必备工具 IIS 中 "另一个程序正在使用此文件,进程无法访问!" JS页面刷新 批处理命令学习(二) 批处理命令学习(一) clean_vss_files.bat Oracle: import tables use .dmp file in PL/SQL Developer
IE6中,一个Button同时打开两个下载窗口,并且可以自动关闭
10cn.net · 2009-07-27 · via 博客园 - 10cn.net

HTML(递归调用关闭)

 1 <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="CsvExport.WebForm1" %>
 2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 3 <HTML>
 4     <HEAD>
 5         <title>WebForm1</title>
 6         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
 7         <meta content="C#" name="CODE_LANGUAGE">
 8         <meta content="JavaScript" name="vs_defaultClientScript">
 9         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
10         <script type="text/javascript">
11         <!--
12             var $ = function(objId) {
13                 return document.getElementById(objId);
14             }
15             window.onload = function() {
16                 $('btn1').onclick = CsvOutPut1;
17                 $('btn2').onclick = CsvOutPut2;
18                 $('btn3').onclick = CsvOutPut3;
19             }
20         
21             function CsvOutPut1() {
22                 $('ifr1').setAttribute('src''Background.aspx?code=A');
23                 setTimeout("$('ifr2').setAttribute('src', 'Background.aspx?code=B')"100);
24             }
25             
26             //説明:IE7はOpenした画面を自動にCloseできること、しかしIE6の方は自動にCloseできないで、手動でClose必要。
27             var subWin = null;
28             function CsvOutPut2() {
29                 subWin = window.open('Background.aspx?code=A','','height=0,width=0,top=8000,left=8000');
30                 setTimeout("closeSubWin()"2000);
31                 setTimeout("document.getElementById('ifr2').setAttribute('src', 'Background.aspx?code=B')"100);
32             }
33             
34             function closeSubWin() {
35                 if (subWin != null && !subWin.closed) {
36                     subWin.close();
37                     setTimeout("closeSubWin()"1000);
38                 }
39                 return;
40             }
41             
42             function CsvOutPut3() {
43                 $('a1').click();
44                 $('a2').click();
45             }
46         //-->
47         </script>
48     </HEAD>
49     <body MS_POSITIONING="GridLayout">
50         <form id="Form1" method="post" runat="server">
51             <asp:Label id="Label2" style="Z-INDEX: 105; LEFT: 120px; POSITION: absolute; TOP: 64px" runat="server"
52                 Width="224px">IE6 IE7 OK</asp:Label>
53             <asp:Label id="Label3" style="Z-INDEX: 106; LEFT: 120px; POSITION: absolute; TOP: 104px" runat="server"
54                 Width="224px">IE7 OK</asp:Label><iframe id="ifr1" width="0" height="0"></iframe>
55             <iframe id="ifr2" width="0" height="0"></iframe><input id="btn1" style="Z-INDEX: 100; LEFT: 24px; POSITION: absolute; TOP: 16px" type="button"
56                 value="Button1"> <input id="btn2" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 56px" type="button"
57                 value="Button2"> <input id="btn3" style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 96px" type="button"
58                 value="Button3"> <id="a1" href="Background.aspx?code=A" target="_blank"></A>
59             <asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 120px; POSITION: absolute; TOP: 24px" runat="server"
60                 Width="224px">IE7 OK</asp:Label><id="a2" href="Background.aspx?code=B"></A></form>
61     </body>
62 </HTML>
63 

CS

 1 using System;
 2 using System.Collections;
 3 using System.ComponentModel;
 4 using System.Data;
 5 using System.Drawing;
 6 using System.Web;
 7 using System.Web.SessionState;
 8 using System.Web.UI;
 9 using System.Web.UI.WebControls;
10 using System.Web.UI.HtmlControls;
11 
12 namespace CsvExport
13 {
14     /// <summary>
15     /// Background の概要の説明です。
16     /// </summary>
17     public class Background : System.Web.UI.Page
18     {
19         private void Page_Load(object sender, System.EventArgs e)
20         {
21             string code = (string)Request.Params["code"];
22             switch(code)
23             {
24                 case "A" :
25                     ot1();
26                     break;
27                 case "B" :
28                     ot2();
29                     break;
30             }
31         }
32 
33         private void ot1()
34         {
35             string strCsv = "1, 2, 3, 4";
36             Response.Clear(); 
37             Response.BufferOutput= false
38             Response.Charset="shift-jis";
39             Response.AppendHeader("Content-Disposition","attachment;filename=t1.csv"); 
40             Response.ContentEncoding=System.Text.Encoding.GetEncoding("shift-jis");
41             Response.ContentType = "application/octet-stream";
42             this.EnableViewState = false;
43             Response.Write(strCsv);
44             Response.End();
45         }
46 
47         private void ot2()
48         {
49             string strCsv = "A, B, C, D";
50             Response.Clear(); 
51             Response.BufferOutput= false
52             Response.Charset="shift-jis";
53             Response.AppendHeader("Content-Disposition","attachment;filename=t2.csv"); 
54             Response.ContentEncoding=System.Text.Encoding.GetEncoding("shift-jis");
55             Response.ContentType = "application/octet-stream";
56             this.EnableViewState = false;
57             Response.Write(strCsv);
58             Response.End();
59         }
60 
61         #region Web フォーム デザイナで生成されたコード 
62         override protected void OnInit(EventArgs e)
63         {
64             //
65             // CODEGEN: この呼び出しは、ASP.NET Web フォーム デザイナで必要です。
66             //
67             InitializeComponent();
68             base.OnInit(e);
69         }
70         
71         /// <summary>
72         /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
73         /// コード エディタで変更しないでください。
74         /// </summary>
75         private void InitializeComponent()
76         {    
77             this.Load += new System.EventHandler(this.Page_Load);
78         }
79         #endregion
80     }
81 }
82 

HTML(setInterval调用关闭)

 1 <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="CsvExport.WebForm1" %>
 2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 3 <HTML>
 4     <HEAD>
 5         <title>WebForm1</title>
 6         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
 7         <meta content="C#" name="CODE_LANGUAGE">
 8         <meta content="JavaScript" name="vs_defaultClientScript">
 9         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
10         <script type="text/javascript">
11         <!--
12             var $ = function(objId) {
13                 return document.getElementById(objId);
14             }
15             window.onload = function() {
16                 $('btn1').onclick = CsvOutPut1;
17                 $('btn2').onclick = CsvOutPut2;
18                 $('btn3').onclick = CsvOutPut3;
19             }
20         
21             function CsvOutPut1() {
22                 $('ifr1').setAttribute('src''Background.aspx?code=A');
23                 setTimeout("$('ifr2').setAttribute('src', 'Background.aspx?code=B')"100);
24             }
25             
26             //説明:IE7はOpenした画面を自動にCloseできること、しかしIE6の方は自動にCloseできないで、手動でClose必要。
27             var subWin = null;
28             var res = null;
29             function CsvOutPut2() {
30                 subWin = window.open('Background.aspx?code=A','','height=0,width=0,top=8000,left=8000');
31                 res = self.setInterval("closeSubWin()"1000);
32                 setTimeout("document.getElementById('ifr2').setAttribute('src', 'Background.aspx?code=B')"100);
33             }
34             
35             function closeSubWin() {
36                 if (subWin != null && !subWin.closed) {
37                     subWin.close();
38                 } else {
39                     window.clearInterval(res);
40                     return;
41                 }
42             }
43             
44             function CsvOutPut3() {
45                 $('a1').click();
46                 $('a2').click();
47             }
48         //-->
49         </script>
50     </HEAD>
51     <body MS_POSITIONING="GridLayout">
52         <form id="Form1" method="post" runat="server">
53             <asp:Label id="Label2" style="Z-INDEX: 105; LEFT: 120px; POSITION: absolute; TOP: 64px" runat="server"
54                 Width="224px">IE6 IE7 OK</asp:Label>
55             <asp:Label id="Label3" style="Z-INDEX: 106; LEFT: 120px; POSITION: absolute; TOP: 104px" runat="server"
56                 Width="224px">IE7 OK</asp:Label><iframe id="ifr1" width="0" height="0"></iframe>
57             <iframe id="ifr2" width="0" height="0"></iframe><input id="btn1" style="Z-INDEX: 100; LEFT: 24px; POSITION: absolute; TOP: 16px" type="button"
58                 value="Button1"> <input id="btn2" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 56px" type="button"
59                 value="Button2"> <input id="btn3" style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 96px" type="button"
60                 value="Button3"> <id="a1" href="Background.aspx?code=A" target="_blank"></A>
61             <asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 120px; POSITION: absolute; TOP: 24px" runat="server"
62                 Width="224px">IE7 OK</asp:Label><id="a2" href="Background.aspx?code=B"></A></form>
63     </body>
64 </HTML>
65