您的位置:首页 > 编程语言 > ASP

Asp.net 2.0 C#实现压缩/解压功能 (示例代码下载)

2008-06-17 14:25 1571 查看
(一). 实现功能

对文件及目录的压缩及解压功能

(二). 运行图片示例

public class ZipClass

5

110public class UnZipClass

114 <body>

2 <form id="form1" runat="server">

3 <div>

4  <asp:Label ID="Label1" runat="server" BackColor="#C0C0FF" Font-Size="XX-Large"

5 Height="44px" Text="压缩文件/文件夹示例" Width="366px"></asp:Label>

6 <asp:Panel ID="Panel1" runat="server" Height="1px" Width="369px" BackColor="#FFFFC0">

7 <table width="100%" height="100%">

8 <tr>

9 <td style="width: 3px" valign="top">

10 <asp:Label ID="lbDisplay" runat="server" Text="压缩目录(from/to):" Width="153px"></asp:Label><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

11 <br />

12 <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

13  <br />

14 <asp:Button ID="btZipDictory" runat="server" OnClick="btZipDictory_Click" Text="压缩目录" /><br />

15 </td>

16 <td style="width: 4px" valign="middle">

17 <asp:Label ID="Label2" runat="server" Text="解压目录(from/to):" Width="154px"></asp:Label>

18 <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>

19 <br />

20 <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>

21  <br />

22 <asp:Button ID="btUnZipDictory" runat="server" Text="解压目录" OnClick="btUnZipDictory_Click" /><br />

23 </td>

24 </tr>

25 <tr>

26 <td style="width: 3px; height: 150px" valign="top">

27 <asp:Label ID="Label3" runat="server" Text="压缩文件(from/to):" Width="153px"></asp:Label>

28 <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>

29 <br />

30 <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>

31  <br />

32 <asp:Button ID="btZipFile" runat="server" Text="压缩文件" OnClick="btZipFile_Click" /><br />

33 </td>

34 <td style="width: 4px; height: 150px" valign="top">

35 <asp:Label ID="Label4" runat="server" Text="解压文件(from/to):" Width="154px"></asp:Label>

36 <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>

37 <br />

38 <asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>

39  <br />

40 <asp:Button ID="btUnZipFile" runat="server" Text="解压文件" OnClick="btUnZipFile_Click" /><br />

41 </td>

42

43 </tr>

44

45 </table>

46 <asp:Label ID="lbMessage" runat="server" Width="368px"></asp:Label><br />

47 <br />

48 </asp:Panel>

49

50 </div>

51 </form>

52</body>

53

3. 后台页面代码

1public partial class _Default : System.Web.UI.Page

2

[align=center][/align]
[align=left](四). 示例代码下载[/align]

http://files.cnblogs.com/ChengKing/ZIP.rar

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1452150
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: