自定義控制項

2021-09-07 06:58:38 字數 1819 閱讀 8151

using system.io;

using icsharpcode.sharpziplib.checksums;

using icsharpcode.sharpziplib.zip;

using icsharpcode.sharpziplib.gzip;

///

/// zipfloclass 的摘要說明

///

public class zipfloclass

private void zip(string strfile, zipoutputstream s, string staticfile)

else // 否則直接壓縮檔案}}

using system;

using system.data;

using system.web;

using system.text;

using system.collections;

using system.io;

using system.diagnostics;

using system.runtime.serialization.formatters.binary;

using icsharpcode.sharpziplib.bzip2;

using icsharpcode.sharpziplib.zip;

using icsharpcode.sharpziplib.zip.compression;

using icsharpcode.sharpziplib.zip.compression.streams;

using icsharpcode.sharpziplib.gzip;

using icsharpcode.sharpziplib.checksums;

///

/// unzipfloclass 的摘要說明

///

public class unzipfloclass

string dir = path.getdirectoryname(theentry.name);

//根目錄下的第一級子資料夾的下的資料夾的名稱

string filename = path.getfilename(theentry.name);

//根目錄下的檔名稱

if (dir != " " )

//建立根目錄下的子資料夾,不限制級別

}else if (dir == " " && filename != "")

//根目錄下的檔案

else if (dir != " " && filename != "")

//根目錄下的第一級子資料夾下的檔案

}if (dir == rootdir)

//判斷是不是需要儲存在根目錄下的檔案

//以下為解壓縮zip檔案的基本步驟

//基本思路就是遍歷壓縮檔案裡的所有檔案,建立乙個相同的檔案。

if (filename != string.empty)

else

}streamwriter.close();}}

s.close();

return rootfile;

}catch (exception ex)} }

4)引用,新建乙個頁面,新增兩個按鈕,為按鈕新增click事件

原始碼如下

protected void button1_click(object sender, eventargs e)

protected void button2_click(object sender, eventargs e)

5)一切ok,可以測試一下,我是可以執行的。

自定義控制項 自定義鐘錶

private context mcontext 畫筆 private paint mpaint 控制項的寬 private int mwidth x方向的圓心座標 private int center 鐘錶的半徑 private int mradio 圓環的寬 private int stroke...

自定義控制項

首先是以下這幾項,attribute defaultproperty指定元件的預設屬性,toolboxdata指定當從ide工具中的 工具箱中拖動自定義控制項時為它生成的預設標記 defaultproperty text toolboxdata mycontrol runat server 上面這些...

自定義控制項

新聞管理 using system using system.collections.generic using system.linq using system.web using system.web.ui using system.web.ui.webcontrols namespace ne...