标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr MySQL恢复 obet ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kcratr_nab_less_than_odr ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 ORACLE恢复 Oracle 恢复 ORACLE数据库恢复 oracle碎片 OSD-04016 YOUR FILES ARE ENCRYPTED 比特币加密文章分类
- MongoDB (1)
- MongoDB恢复 (1)
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (112)
- 数据库 (1,885)
- DB2 (22)
- MySQL (82)
- Oracle (1,710)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (73)
- Oracle Bug (8)
- Oracle RAC (56)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (663)
- Oracle安装升级 (108)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (91)
- PostgreSQL (37)
- pdu工具 (7)
- PostgreSQL恢复 (13)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (5)
- 达梦恢复 (3)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (52)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (35)
- MongoDB (1)
-
最近发表
- rmanext:从损坏的 Oracle RMAN 备份中强制提取数据文件
- 恢复案例分享:win丢失数据文件恢复
- 记录19c ASM磁盘掉线触发ORA-59048故障处理
- aix平台Oracle数据库由于断电无法启动故障处理
- 断电引起ORA-600 3005故障处理
- 记录一次云存储资源到期之后引起的数据库恢复
- Firebird 损坏数据库数据抢救工具—firebirdext
- Oracle 19c 202610补丁(RUs+OJVM)-19.33
- 由于con$.con#值达到极限,触发数据库增加约束报ORA-600 12807错误
- MongoDB 离线提取工具—mongoext
- .bres勒索病毒加密数据库dmp文件可恢复
- ORA-600 krsm_mrp_rebuild_lf_list.lno_mismatch
- 记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复
- 不当数据库恢复操作导致一个月数据丢失
- obet快速修复oracle 位图损坏块
- 不太常见的10.2.0.1的oracle redo损坏恢复
- obet forcecopy功能抢救硬件故障中的数据文件
- kcratr_nab_less_than_odr和system坏块故障处理
- 通过obet 恢复system坏块,打开数据库
- obet dbv功能完整说明
分类目录归档:软件开发
js考试系统时间倒计时
js实现时分倒计时、悬浮效果
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312" />
</head>
<body onload='ChangeTime();scall();'>
<form id="form1">
<!--模拟页面宽度高度-->
<div align="center">
<center>
<table width="770" height="3000" border="0" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4">
<tr>
<td width="100%" valign="top"></td>
</tr>
</table>
</center>
</div>
<!--弹出时间提示-->
<div id="Javascript.RightDiv" style="position: absolute;z-index:1000;width:200px;height:30px;top:-1000px;word-break:break-all;display:none;">
<div id="timeshow" style="width:200px;height:20px;line-height:20px;text-align:center;font-size:12px;color:#000;background-color:#CCC;border:1px solid #333;"></div>
</div>
<SCRIPT LANGUAGE="JavaScript">
//弹出div
var showad = true;
var Toppx = 10; //上端位置
var AdDivW = 200; //宽度
var AdDivH = 25; //高度
var PageWidth = 750; //页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 1000; //最小屏幕宽度象素
function scall(){
if(!showad){return;}
var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;
document.getElementById("Javascript.RightDiv").style.display="";
document.getElementById("Javascript.RightDiv").style.top=document.body.scrollTop+Toppx;
document.getElementById("Javascript.RightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("Javascript.RightDiv").offsetWidth-Borderpx;
}
window.onscroll=scall;
window.onresize=scall;
//在线考试时间提示
var h=1; //设置考试时间(小时单位)
var m=0.1; //设置考试时间(分钟单位)
var timeShowId="timeshow"; //设置时间显示层ID
var TimeNum=h*60*60+m*60;
var timeStr;
function ChangeTime()
{
TimeNum--;
if(TimeNum > 0)
{
timeStr=setTimeout("ChangeTime()",1000);
if(TimeNum<300)
{
alert('距离系统自动提交时间还剩5分钟,请尽快做好提交准备');
}
if(TimeNum<30)
{
alert('距离系统自动提交时间还剩30秒,请马上交卷');
}
}
else
{
//系统提交 完善
}
document.getElementById(timeShowId).innerHTML="系统提示:你的时间还剩<span style=\"color:#FF0000;\">"+Math.floor(TimeNum/60)+"分"+TimeNum%60+"秒</span>";
}
</SCRIPT>
</form>
</body >
</html>
发表在 JavaScript
评论关闭
通过web更新网站(1)
现在维护的网站比较多,经常因为要修改一个小小的东西,要远程登录,或者ftp登录上去下载下来,然后在修改后,再上传上去,总之比较麻烦,我现在总体设想是通过web实现手工的更新网站,既实现通过web下载、上传、删除、编辑。
今天是实现了对整个站点的文件显示,下载和上传到对应目录,为该程序的第一部分
aspx代码
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function select_dir() {
var select = document.getElementById("selectType");
document.getElementById("h_dir").value = select.options[select.selectedIndex].value; ;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="h_dir" type="hidden" runat="server"/>
<asp:Label ID="lbl_dir" runat="server" ></asp:Label>
<asp:Button ID="btn_select" runat="server" Text="查看文件"
onclick="btn_select_Click" />
<div style="width:400px; height:500px; overflow:auto">
<asp:Label ID="show_file" runat="server" ></asp:Label>
</div>
<asp:FileUpload ID="file_up" runat="server" />
<asp:Button ID="btn_up" runat="server" Text="上传文件" onclick="btn_up_Click" />
</form>
</body>
</html>
cs代码
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.Threading;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string web_file=Server.MapPath(".");
DirectoryInfo thisOne = new DirectoryInfo(web_file);
lbl_dir.Text="<select id='selectType' onclick='select_dir();' ><option value='" + System.Web.HttpContext.Current.Server.UrlEncode(web_file) + "'>网站目录</option>" + ListSelectShow(thisOne, 0, "") + "</select>";
h_dir.Value = System.Web.HttpContext.Current.Server.UrlEncode(web_file);
if (Request.QueryString["F"]!=null)
{
string d_file = System.Web.HttpContext.Current.Server.UrlDecode(Request.QueryString["F"].ToString());
//求文件名
string[] fs = d_file.Split('\\');
string ext = fs[fs.Length - 1];
//下载文件
Page.Response.Clear();
bool success = ResponseFile(Page.Request, Page.Response, ext, d_file, 1024000);
if (!success)
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('下载文件失败,请重试');", true);
Page.Response.End();
}
}
}
public string ListTreeShow(DirectoryInfo theDir, int nLevel, string Rn)//递归目录和 文件,树形结构显示
{
if (nLevel == 0)
{
FileInfo[] fileInfo = theDir.GetFiles();
foreach (FileInfo fInfo in fileInfo)
{
Rn += "├";
Rn += "<a href='Default.aspx?F=";
Rn = Rn + System.Web.HttpContext.Current.Server.UrlEncode(fInfo.FullName);
Rn += "'>";
Rn += fInfo.Name.ToString() + "</a> <br />";
}
}
DirectoryInfo[] subDirectories = theDir.GetDirectories();//获得目录
foreach (DirectoryInfo dirinfo in subDirectories)
{
if (nLevel == 0)
{
Rn += "├";
}
else
{
string _s = "";
for (int i = 1; i <= nLevel; i++)
{
_s += "│ ";
}
Rn += _s + "├";
}
Rn += "<b>" + dirinfo.Name.ToString() + "</b><br />";
FileInfo[] fileInfo = dirinfo.GetFiles(); //目录下的文件
foreach (FileInfo fInfo in fileInfo)
{
if (nLevel == 0)
{
Rn += "│ ├";
}
else
{
string _f = "";
for (int i = 1; i <= nLevel; i++)
{
_f += "│ ";
}
Rn += _f + "│ ├";
}
Rn += "<a href='Default.aspx?F=";
Rn = Rn + System.Web.HttpContext.Current.Server.UrlEncode(fInfo.FullName);
Rn += "'>";
Rn += fInfo.Name.ToString() + "</a><br />";
}
Rn = ListTreeShow(dirinfo, nLevel + 1, Rn);
}
return Rn;
}
public static string ListSelectShow(DirectoryInfo theDir, int nLevel, string Rn)//递归目录下拉框显示
{
DirectoryInfo[] subDirectories = theDir.GetDirectories();//获得目录
foreach (DirectoryInfo dirinfo in subDirectories)
{
Rn += "<option value=\"" +System.Web.HttpContext.Current.Server.UrlEncode( dirinfo.FullName) + "\" >";
if (nLevel == 0)
{
Rn += "├";
}
else
{
string _s = "";
for (int i = 1; i <= nLevel; i++)
{
_s += "│ ";
}
Rn += _s + "├";
}
Rn += "" + dirinfo.Name.ToString() + "</option>";
Rn = ListSelectShow(dirinfo, nLevel + 1, Rn);
}
return Rn;
}
protected void btn_select_Click(object sender, EventArgs e)
{
string first_dir = System.Web.HttpContext.Current.Server.UrlDecode(h_dir.Value);
DirectoryInfo thisOne = new DirectoryInfo(first_dir);
show_file.Text = ListTreeShow(thisOne, 0, "");
}
public bool ResponseFile(HttpRequest _Request, HttpResponse _Response, string _fileName, string _fullPath, long _speed)//下载文件
{
try
{
FileStream myFile = new FileStream(_fullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
BinaryReader br = new BinaryReader(myFile);
try
{
_Response.AddHeader("Accept-Ranges", "bytes");
_Response.Buffer = false;
long fileLength = myFile.Length;
long startBytes = 0;
double pack = 10240; //10K bytes
//int sleep = 200; //每秒5次 即5*10K bytes每秒
int sleep = (int)Math.Floor(1000 * pack / _speed) + 1;
if (_Request.Headers["Range"] != null)
{
_Response.StatusCode = 206;
string[] range = _Request.Headers["Range"].Split(new char[] { '=', '-' });
startBytes = Convert.ToInt64(range[1]);
}
_Response.AddHeader("Content-Length", (fileLength - startBytes).ToString());
if (startBytes != 0)
{
//Response.AddHeader("Content-Range", string.Format(" bytes {0}-{1}/{2}", startBytes, fileLength-1, fileLength));
}
_Response.AddHeader("Connection", "Keep-Alive");
_Response.ContentType = "application/octet-stream";
_Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(_fileName, System.Text.Encoding.UTF8));
br.BaseStream.Seek(startBytes, SeekOrigin.Begin);
int maxCount = (int)Math.Floor((fileLength - startBytes) / pack) + 1;
for (int i = 0; i < maxCount; i++)
{
if (_Response.IsClientConnected)
{
_Response.BinaryWrite(br.ReadBytes(int.Parse(pack.ToString())));
Thread.Sleep(sleep);
}
else
{
i = maxCount;
}
}
}
catch
{
return false;
}
finally
{
br.Close();
myFile.Close();
}
}
catch
{
return false;
}
return true;
}
protected void btn_up_Click(object sender, EventArgs e)
{
if (file_up.HasFile)
{
try
{
string path = System.Web.HttpContext.Current.Server.UrlDecode(h_dir.Value);
string file = file_up.FileName;
file_up.SaveAs(path + "/" + file);
DirectoryInfo thisOne = new DirectoryInfo(path);
show_file.Text = ListTreeShow(thisOne, 0, "");
}
catch
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('上传文件失败,请重试');", true);
}
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('请选择文件');", true);
}
}
}
发表在 Asp.Net
评论关闭
js控制网页在特定iframe中打开
我们在编写系统管理后台时,很多时候会使用到iframe进行管理,但是有有个问题就是有些时候比较聪明的用户会绕过我们的iframe的父页面,而直接打开了iframe中src的内容,如果这样,重则给我们的系统带来破坏,轻则使我们系统的有些功能不能正常使用,今天用js写了一个控制脚本,可以让用户无法绕开iframe的父页而直接打开子页的内容进行浏览,主要通过在iframe在子父页面各加一段js脚本实现控制
父页面
function check_iframe() {
var url = location.search;//包括?的参数
if (url.indexOf("?")!=-1) {
var str = url.substr(1); //传输过来的url
document.getElementById("main").src = decodeURI(str);
}
}
说明:1、要使用onload或者类此这个事件加载该函数
2、main表示父页面中要显示子页面的iframe的id
3、传过来的url是通过get方式,使用encodeURI编码的
子页面
function check_page() {
var iframe_url = document.referrer.toLowerCase();
if (iframe_url == "") {
document.location.href = "default.aspx?" + encodeURI(document.location.href);
}
//防止在子页面中点击本页面自身超链时再次打开一个iframe
else if (iframe_url.indexOf("default.aspx") == -1 && document.location.href.toLowerCase().indexOf(iframe_url) == -1)
{ document.location.href = "default.aspx?" + encodeURI(document.location.href); }
}
说明:1、要使用onload或者类此这个事件加载该函数
2、supadmin.html表示是含有该页面显示的iframe的父页面
3、使用encodeURI对子页面的url进行了编码,使用get方式传送给父页面
发表在 JavaScript
评论关闭


加我微信(17813235971)
加我QQ(107644445)

