淺談C#的表單調用

來源:互聯網
上載者:User

本文主要介紹C#表單裡調用,包括介紹在表單裡放置兩個命令按鈕等方面。

有了壓縮和解壓縮的類以後,就要在C#表單裡調用了。怎嗎?是新手,不會調用?ok,接著往下看如何在C#表單裡調用。首先在表單裡放置兩個命令按鈕(不要告訴我你不會放啊~)。

編寫以下源碼:

///
<summary>

/// 調用源碼
///
</summary>

private void button2_Click_1(object sender, System.EventArgs e)
{
string []FileProperties=new string[2];
FileProperties[0]="C:\\unzipped\\";//待壓縮檔目錄
FileProperties[1]="C:\\zip\\a.zip"; //壓縮後的目標檔案
ZipClass Zc=new ZipClass();
Zc.ZipFileMain(FileProperties);
}

private void button2_Click(object sender, System.EventArgs e)
{
string []FileProperties=new string[2];
FileProperties[0]="C:\\zip\\test.zip";//待解壓的檔案
FileProperties[1]="C:\\unzipped\\";//解壓後放置的目標目錄
UnZipClass UnZc=new UnZipClass();
UnZc.UnZip(FileProperties);
}

好了,到此為止,如何壓縮和解壓縮的類都已經完成了,需要的朋友直接拿走調吧。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.