进度条(很牛)(html 支持asp,asp.net,dotnet,java,j2ee,php)
2012-11-08 21:24
573 查看
/*
ProgressBar.htm
*/
<html>
<head>
<title></title>
<script language="javascript">
//设置进度条进度
function SetPorgressBar(msg, pos)
{
ProgressBar.style.width= pos + "%";
WriteText("Msg1",msg + "已完成" + pos + "%");
}
//设置进度条完成信息
function SetCompleted(msg)
{
if(msg=="")
WriteText("Msg1","完成。");
else
WriteText("Msg1",msg);
}
// 更新文本显示信息
function WriteText(id, str)
{
var strTag = '<font face="Verdana, Arial, Helvetica" size="2" color="#ea9b02"><B>' + str + '</B></font>';
if (document.all) document.all[id].innerHTML = strTag;
}
</script>
</head>
<body>
<div align="center" style="font-size:12px;position:absolute;TOP:184px;LEFT:250px;overflow:visible">
<div align="left" id="Msg1"><font face="Verdana, Arial, Helvetica" size="2" color="#ea9b02"><b>正在加载</b></font></div>
<div align="left" id="ProgressBarSide" style="color:Silver;border-width:1px;border-style:Solid;width:300px;">
<div align="left" id="ProgressBar" style="background-color:#3366FF; height:21px; width:0%;"></div>
</div>
</div>
</body>
</html>
/*
.cs中加
*/
//加进度条
string templateFileName = Path.Combine(Server.MapPath("."), "ProgressBar.htm");
StreamReader reader = new StreamReader(@templateFileName,System.Text.Encoding.GetEncoding("gb2312"));
string html = reader.ReadToEnd();
reader.Close();
Response.Write(html);
Response.Flush();
System.Threading.Thread.Sleep(200);
string jsBlock;
//加进度条
//--------------------------------------------------------------------------------------
for(int i=0;i<ip;i++)
{
//加进度条进程
//path 为文件名
System.Threading.Thread.Sleep(10);
jsBlock = "<script>SetPorgressBar('" +path + "','" + ((Convert.ToDouble(i)/Convert.ToDouble(ip))*100).ToString("N") + "');</script>";
Response.Write(jsBlock);
Response.Flush();
//加进度条进程
}
转载
ProgressBar.htm
*/
<html>
<head>
<title></title>
<script language="javascript">
//设置进度条进度
function SetPorgressBar(msg, pos)
{
ProgressBar.style.width= pos + "%";
WriteText("Msg1",msg + "已完成" + pos + "%");
}
//设置进度条完成信息
function SetCompleted(msg)
{
if(msg=="")
WriteText("Msg1","完成。");
else
WriteText("Msg1",msg);
}
// 更新文本显示信息
function WriteText(id, str)
{
var strTag = '<font face="Verdana, Arial, Helvetica" size="2" color="#ea9b02"><B>' + str + '</B></font>';
if (document.all) document.all[id].innerHTML = strTag;
}
</script>
</head>
<body>
<div align="center" style="font-size:12px;position:absolute;TOP:184px;LEFT:250px;overflow:visible">
<div align="left" id="Msg1"><font face="Verdana, Arial, Helvetica" size="2" color="#ea9b02"><b>正在加载</b></font></div>
<div align="left" id="ProgressBarSide" style="color:Silver;border-width:1px;border-style:Solid;width:300px;">
<div align="left" id="ProgressBar" style="background-color:#3366FF; height:21px; width:0%;"></div>
</div>
</div>
</body>
</html>
/*
.cs中加
*/
//加进度条
string templateFileName = Path.Combine(Server.MapPath("."), "ProgressBar.htm");
StreamReader reader = new StreamReader(@templateFileName,System.Text.Encoding.GetEncoding("gb2312"));
string html = reader.ReadToEnd();
reader.Close();
Response.Write(html);
Response.Flush();
System.Threading.Thread.Sleep(200);
string jsBlock;
//加进度条
//--------------------------------------------------------------------------------------
for(int i=0;i<ip;i++)
{
//加进度条进程
//path 为文件名
System.Threading.Thread.Sleep(10);
jsBlock = "<script>SetPorgressBar('" +path + "','" + ((Convert.ToDouble(i)/Convert.ToDouble(ip))*100).ToString("N") + "');</script>";
Response.Write(jsBlock);
Response.Flush();
//加进度条进程
}
转载
相关文章推荐
- .NET/ASP.NET/C#/WCF/SQL Server/My SQL/Java/JSP/JDBC/Spring/Spring MVC/PHP/Python/Ruby/Shell/Agile/CSS/HTML/HTTP/Unix/Linux大量PDF书籍/电子书籍下载, Effective Java 下载
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- atitit.软件开发GUI 布局管理优缺点总结java swing wpf web html c++ qt php asp.net winform
- html asp php java 清除缓存
- VCPP/CPP/PHP_统计图插件-ChartDirector(ASP/COM/VB/.NET/JSP/Java/ColdFusion/Perl/Python/Ruby)
- 服务器完美设置,支持asp php cgi jsp asp.net mysql!
- 建站有很多技术,如 HTML、HTML5、XHTML、CSS、SQL、JavaScript、PHP、http://ASP.NET、Web Services、浏览器脚本、服务器脚本等。它们的区别是什么?新手一点不懂,想理清所有这些技术之间的关系和应用范围。
- ASP.NET支持表单中上传HTML代码的简单方法(不安全)
- Atitit.js跨域解决方案attilax大总结 后台java php c#.net的CORS支持
- flash 头像上传裁剪预览支持多种语言php,jsp,asp,asp.net
- JSP 、J2EE 、C# 、asp.net 、vb、VB.net、php、 Android,FPGA,MATLAB,QT,程序开发
- 招聘全职专用离岸Phpasp.netflashjava Developersprogrammers在印度
- Web 建站技术中,HTML、HTML5、XHTML、CSS、SQL、JavaScript、PHP、ASP.NET、Web Services 是什么?
- html asp php java 清除缓存