一个模拟WinForm进度条的DEMO
把前段时间用过的进度条例子进行了一次小小的处理,
以方便以后的使用,因为在WEB中要实现WINFORM的进度条比较难....
当时也查了不少相关的资料...(哈哈...)
效果如下图
前台代码没什么不同,操作都在后台.也希望大伙能用得上
第二次写这个还不知怎么上传文件,试了好几次都没成功,所以就不加DEMO了
1 <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebDemo1.WebForm1" %>
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3 <HTML>
4 <HEAD>
5 <title>WebForm1</title>
6 <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
7 <meta name="CODE_LANGUAGE" Content="C#">
8 <meta name="vs_defaultClientScript" content="JavaScript">
9 <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
10 </HEAD>
11 <body MS_POSITIONING="GridLayout">
12 <form id="Form1" method="post" runat="server">
13 <asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 384px; POSITION: absolute; TOP: 248px"
14 runat="server"></asp:DropDownList>
15 <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 464px; POSITION: absolute; TOP: 248px" runat="server"
16 Text="Button"></asp:Button>
17 <asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 392px; POSITION: absolute; TOP: 112px" runat="server">模拟WEB进度条</asp:Label>
18 <asp:Label id="Label2" style="Z-INDEX: 104; LEFT: 392px; POSITION: absolute; TOP: 160px" runat="server">Creator:WinKen</asp:Label>
19 <asp:Label id="Label3" style="Z-INDEX: 105; LEFT: 392px; POSITION: absolute; TOP: 208px" runat="server">CreateDate:070510</asp:Label>
20 </form>
21 </body>
22 </HTML>
23
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3 <HTML>
4 <HEAD>
5 <title>WebForm1</title>
6 <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
7 <meta name="CODE_LANGUAGE" Content="C#">
8 <meta name="vs_defaultClientScript" content="JavaScript">
9 <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
10 </HEAD>
11 <body MS_POSITIONING="GridLayout">
12 <form id="Form1" method="post" runat="server">
13 <asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 384px; POSITION: absolute; TOP: 248px"
14 runat="server"></asp:DropDownList>
15 <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 464px; POSITION: absolute; TOP: 248px" runat="server"
16 Text="Button"></asp:Button>
17 <asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 392px; POSITION: absolute; TOP: 112px" runat="server">模拟WEB进度条</asp:Label>
18 <asp:Label id="Label2" style="Z-INDEX: 104; LEFT: 392px; POSITION: absolute; TOP: 160px" runat="server">Creator:WinKen</asp:Label>
19 <asp:Label id="Label3" style="Z-INDEX: 105; LEFT: 392px; POSITION: absolute; TOP: 208px" runat="server">CreateDate:070510</asp:Label>
20 </form>
21 </body>
22 </HTML>
23
后台代码及实现
using System;
using System.Collections;
using System.Text;
using System.Threading;
using System.Web.UI;
namespace WebDemo1
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : Page
{
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.DropDownList DropDownList1;
页面事件 
Web 窗体设计器生成的代码
页面方法
}
}


浙公网安备 33010602011771号