1 <html xmlns="http://www.w3.org/1999/xhtml" >
2 <head runat="server">
3 <script language="javascript">
4 mainLoop = function()
5 {
6 var objPath = document.getElementById("TextBox2");
7 var blnValue = _Default.CheckControlFiles(objPath.value);
8 //a.value = a.value + blnValue.value;
9 if( blnValue.value == true)
10 {
11 var returnvalue=setTimeout('mainLoop()', 1000);
12 }
13 else
14 {
15 var objStatus = document.getElementById("Label1");
16 objStatus.innerText = "状态: 下载完成!";
17
18 var btOK = document.getElementById("btOK");
19 btOK.disabled = "";
20
21 var btCancel = document.getElementById("btCancel");
22 btCancel.disabled = "disabled";
23
24 }
25 }
26
27
28 </script>
29
30 </head>
31 <body>
32 <form id="frmTest" runat="server" >
33 <table bgcolor="#ffcc66"><tr><td style="height: 259px">
34 <br />
35 <strong><span style="color: #000099">
36 下载组件:
37 <br />
38 1. 支持多线程: 多个线程某时刻下载同一个文件的不同块.<br />
39 2. 断点续传: 如果下载了一个文件的某些块(一半), 则下次<br />
40
下载时只需下载未完成的块;
41 文件块的下载状<br />
42
态用控制文件记录.
43 块下载完成的先后顺序不<br />
44
一定是连续的.<br />
45 </span></strong>
46 <br />
47 <table style="width: 379px">
48 <tr>
49 <td colspan="1" style="width: 87px">
50 Source</td>
51 <td colspan="2" style="width: 326px">
52 <asp:TextBox ID="TextBox1" runat="server" Width="391px">
http://www.</asp:TextBox></td>
53 </tr>
54 <tr>
55 <td colspan="1" style="width: 87px">
56 Location</td>
57 <td colspan="2" style="width: 326px">
58 <asp:TextBox ID="TextBox2" runat="server"
Width="391px">D:\Documents and Settings\zhengjian\桌面\TestDownLoads\</asp:TextBox></td>
59 </tr>
60 <tr>
61 <td colspan="1" style="width: 87px">
62 Threads</td>
63 <td colspan="2" style="width: 326px">
64 <asp:TextBox ID="TextBox3" runat="server" Width="390px">
10</asp:TextBox></td>
65 </tr>
66 </table>
67 <br />
68 <asp:Button ID="btOK" runat="server" Text="下载" Height="42px"
Width="108px" OnClick="btOK_Click" />
69 <asp:Button ID="btCancel" runat="server"
OnClick="btCancel_Click" Text="取消/暂停" Height="42px" Width="108px"
Enabled="False" /><br />
70 <br />
71 <asp:Label ID="Label1" runat="server" Height="32px"
Text="状态: 未开始下载" Width="227px" Font-Bold="True"
ForeColor="#8080FF"></asp:Label><br />
72 </td></tr></table>
73 <script language=javascript>
74 mainLoop();
75 </script>
76 </form>
77 </body>
78 </html>