急急急! 打酱油!100分! .NET 短信发送加进度条源码!
.NET 短信发送加进度条源码!
[解决办法]
我手机里面有,但是不知道怎么做的,期待答案
[解决办法]
木有类 顶帖以示存在
[解决办法]
<title>进度条</title>
<style type="text/css">
body{
text-align:center;
}
.graph{
width:50px;
border:1px solid #F8B3D0;
height:25px;
}
#bar{
display:block;
background:#FFE7F4;
float:left;
height:100%;
text-align:center;
}
#barNum{
position:absolute;
}
</style>
<script type="text/javascript">
function $(obj){
return document.getElementById(obj);
}
function go(){
$("bar").style.width = parseInt($("bar").style.width) + 1 + "%";
$("bar").innerHTML = $("bar").style.width;
if($("bar").style.width == "100%"){
window.clearInterval(bar);
}
}
var bar = window.setInterval("go()",50);
window.onload = function(){
bar;
}
</script>
</head>
<body>
<div class="graph">
<strong id="bar" style="width:1%;"></strong>
</div>
</body>
</html>
[解决办法]
学习学习
[解决办法]
可以使用js追加输出。这个是我用.net的源码。你可以修改后使用
首先建立ProgressBar.cs
using System;
using System.Collections.Generic;
using System.Text;
public class ProgressBar
{
/// <summary>
/// 进度条的初始化
/// </summary>
public static void Start()
{
Start("正在加载...");
}
/// <summary>
/// 进度条的初始化
/// </summary>
/// <param name="msg">最开始显示的信息</param>
public static void Start(string msg)
{
var sbProgressBar = new StringBuilder();
sbProgressBar.Append("<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title></title>\r\n\r\n");
sbProgressBar.Append("<link href="/xrmanage/css/css.css" rel="stylesheet" type="text/css" />\r\n ");
sbProgressBar.Append("<style>body {text-align:center;margin-top: 50px;}#ProgressBarSide {height:25px;border:1px #2F2F2F;width:65%;background:#EEFAFF;}</style>\r\n ");
sbProgressBar.Append("<script language="javascript">\r\n ");
sbProgressBar.Append("function SetPorgressBar(msg, pos)\r\n ");
sbProgressBar.Append("{\r\n ");
sbProgressBar.Append("document.getElementById('ProgressBar').style.width = pos + "%";\r\n ");
sbProgressBar.Append("WriteText('Msg1',msg + " 已完成" + pos + "%");\r\n ");
sbProgressBar.Append("}\r\n ");
sbProgressBar.Append("function SetCompleted(msg)\r\n{\r\nif(msg=="")\r\nWriteText("Msg1","完成。");\r\n ");
sbProgressBar.Append("else\r\nWriteText("Msg1",msg);\r\n}\r\n ");
sbProgressBar.Append("function WriteText(id, str)\r\n ");
sbProgressBar.Append("{\r\n ");
sbProgressBar.Append("var strTag = '<span style="font-family:Verdana, Arial, Helvetica;font-size=11.5px;color:#DD5800">' + str + '</span>';\r\n ");
sbProgressBar.Append("document.getElementById(id).innerHTML = strTag;\r\n ");
sbProgressBar.Append("}\r\n ");
sbProgressBar.Append("</script>\r\n</head>\r\n<body>\r\n ");
sbProgressBar.Append("<div id="Msg1"><span style="font-family:Verdana, Arial, Helvetica;font-size=11.5px;color:#DD5800">" + msg + "</span></div>\r\n ");
sbProgressBar.Append("<div id="ProgressBarSide" align="left" style="color:Silver;border-width:1px;border-style:Solid;">\r\n ");
sbProgressBar.Append("<div id="ProgressBar" style="background-color:#008BCE; height:25px; width:0%;color:#fff;"></div>\r\n ");
sbProgressBar.Append("</div>\r\n</body>\r\n</html>\r\n ");
System.Web.HttpContext.Current.Response.Write(sbProgressBar.ToString());
System.Web.HttpContext.Current.Response.Flush();
}
/// <summary>
/// 滚动进度条
/// </summary>
/// <param name="Msg">在进度条上方显示的信息</param>
/// <param name="Pos">显示进度的百分比数字</param>
public static void Roll(string Msg, int Pos)
{
string jsBlock = "<script language="javascript">SetPorgressBar('" + Msg + "'," + Pos + ");</script> ";
System.Web.HttpContext.Current.Response.Write(jsBlock);
System.Web.HttpContext.Current.Response.Flush();
}
}