📄 mini.aspx
字号:
<%@ page language="C#" autoeventwireup="true" inherits="up, App_Web_oir78e53" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>文件上传</title>
<!----------------------------以下为脚本区,请务改动----------------->
<script type="text/javascript" language="javascript">
function makeRequest(url,src)
{
kuangjia=1;
var http_request = false;
if (window.XMLHttpRequest)
{ // Mozilla, Safari,
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {http_request.overrideMimeType('text/xml');}
}
else if(window.ActiveXObject)
{ // IE
try
{
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
}
if (!http_request)
{
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function(){ alertContents(http_request,src) }
http_request.open('GET', url, true);
http_request.send(null);
}
function alertContents(http_request,src)
{
if (http_request.readyState == 4)
{
if (http_request.status == 200) {src.innerHTML= http_request.responseText;}
else {src.innerHTML='服务器忙,无法回应';}
kuangjia=0;
}
}
var kuangjia=0;
var made=0;
var ExtenName=<% Response.Write("'"+ class1.ExtenName+"'"); %>
function window.onbeforeunload()
{
made=made+1;
if(made==3){ return '离开页面将使文件上传终止'; }
}
function ToggleVisibility(id, type)
{
td1.style.border ='';
div1.style.display ='none';
if(document.getElementById('AttachFile').value=='')
{
td1.style.border ='#ff0000 thin solid';
div1.style.display ='block';
div1.innerHTML='您没选择文件';
return false;
}
var s=document.getElementById('AttachFile').value;
var s=s.toString();
var i=s.length;
while(s.substring(i,i+1)!='.' && i>0)
{
i=i-1;
}
if(i==0)
{
td1.style.border ='#ff0000 thin solid';
div1.style.display ='block';
div1.innerHTML='文件名格式不对,请重新选择';
return false;
}
if(ExtenName.indexOf(s.substring(i,s.length).toLowerCase())!=-1)
{
td1.style.border ='#ff0000 thin solid';
div1.style.display ='block';
div1.innerHTML='无法支持'+s.substring(i,s.length)+'格式文件';
return false;
}
s=document.getElementById('AttachFile').value.toString();
if(s.indexOf("'")!=-1 || s.indexOf(" ")!=-1 || s.indexOf("<")!=-1 || s.indexOf(">")!=-1 || s.indexOf(";")!=-1)
{
td1.style.border ='#ff0000 thin solid';
div1.style.display ='block';
div1.innerHTML='无法支持带引号,空格,尖括号,分号的文件名';
return false;
}
el = document.getElementById(id);
if(type == 'on')
{
el.style.display = 'block';
file.style.display ='none';
window.setInterval(getp,1000);
made=made+1;
}
}
function jixu_click()
{
t1.style.display ='none';
file.style.display ='block';
}
function getp()
{
if(kuangjia==1)return;
var url='<% Response.Write(class1.up); %>p.aspx?UploadID1=<% Response.Write(UploadID.Value.Trim()); %>&mode=1';
makeRequest(url,p);
}
</script>
<!----------------------------以上为脚本区,请务改动----------------->
</head>
<body style ="background-color : Transparent ; margin : 0px; text-align : center ; vertical-align : middle">
<table border="0" cellpadding="0" cellspacing ="0" style=" width : 100% ; height : 100% ; text-align : center ; vertical-align : middle">
<tr>
<td>
<form id="form1" runat="server" onsubmit ="return ToggleVisibility('p','on');">
<table border ="0" cellpadding ="0" cellspacing ="0" runat="server" id="t1" visible ="false">
<tr><td>文件地址:<asp:TextBox ID="TextBox1" runat="server" Width="400px"></asp:TextBox><input id="Button1" type="button" value="继续" onclick ="jixu_click()"/></td></tr>
</table>
<div id="file" runat ="server">
<table border ="0" cellpadding ="0" cellspacing ="0">
<tr>
<td id="td1"><input id="UploadID" type="hidden" runat ="server"/>选择文件:<asp:FileUpload ID="AttachFile" runat="server" /><asp:Button ID="Upload" runat="server" Text="上传" OnClick="Upload_Click"/><div style =" color :#ff0000 ; display : none" id="div1">您还没选择文件</div></td>
</tr>
<tr style ="display : none;"><td><asp:TextBox ID="TextBox3" runat="server" TextMode="Password" Width="302px" MaxLength="16"></asp:TextBox> <asp:TextBox ID="TextBox4" runat="server" TextMode="Password" Width="299px" MaxLength="16"></asp:TextBox></td></tr>
</table>
</div>
<div id="p" style=" width : 450px ; height : 22px ; display : none ; text-align : left ;border-right: #75b8af thin solid; border-top: #75b8af thin solid; border-left: #75b8af thin solid; border-bottom: #75b8af thin solid;"></div>
</form>
</td>
</tr>
</table>
<table border ="0" cellpadding ="0" cellspacing ="0" width ="100%" style ="display : none ;">
<tr>
<td style =" text-align : left ; color : #666666"><a href="http://www.797net.com" target ="_blank" style ="color : #666666">制造商:797net</a></td>
<td style =" text-align : right"><asp:Label ID="banbeng" runat="server" Text="Label"></asp:Label></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -