Time of Update: 2018-12-07
本次樣本主要實現:1.壓縮檔夾及其下檔案2.壓縮檔夾下檔案3.壓縮檔夾及其下檔案為rar 還是 zip4.解壓縮5.加密壓縮及解加密壓縮-----------範例程式碼如下:protected void Button1_Click(object sender, EventArgs e) { string strtxtPath = "C:\\freezip\\free.txt"; string strzipPath =
Time of Update: 2018-12-07
1、在C#中,string str = null 與 string str = “” 請盡量使用文字或圖象說明其中的區別。 回答要點:說明詳細的空間分配。(10分) 答:string str = null 是不給他分配記憶體空間,而string str = "" 給它分配長度為空白字串的記憶體空間. 2、請詳述在dotnet中類(class)與結構(struct)的異同:(10分)
Time of Update: 2018-12-07
我剛學C#,這個例子我覺得很好,想跟大家分享一下,但是網上又找不到現成的,就只好一個一個的敲,就當是練字吧。----------------------------------------C#中有關於:按 值 和 引用 傳遞參數
Time of Update: 2018-12-07
//日期相減 擷取天數 function DateDiff(sDate1, sDate2) { var aDate, oDate1, oDate2, iDays aDate = sDate1.split("-") oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //轉換為12-18-2002格式
Time of Update: 2018-12-07
#include <windows.h>int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil){char system[MAX_PATH];char pathtofile[MAX_PATH]; HMODULE GetModH = GetModuleHandle(NULL);//得到當前執行檔案的全路徑
Time of Update: 2018-12-07
public static void CopyDir(string fromDir, string toDir){ if (!Directory.Exists(fromDir)) return; if (!Directory.Exists(toDir)) { Directory.CreateDirectory(toDir); } string[] files = Directory.GetFiles(fromDir); foreac
Time of Update: 2018-12-07
事件,其實就是將物體的某個過程處理通過委託(delegate, 也就是函數指標) 的方式公開給外部的自訂函數處理。 C# 可以使用多播委託,但實際上一般情況下只需要用到單播。事件需要通過調用到那個委託的代碼觸發才可以被調用。以下用例子來說明。首先我們定義一個委託:namespace EventDemo{public delegate void ProcessHandler(object sender);}最簡單的事件定義方式:namespace EventDemo{public class
Time of Update: 2018-12-07
1, 請你說說.NET中類和結構的區別? 答:結構和類具有大體的文法,但是結構受到的限制比類要多。結構不能申明有預設的建構函式,為結構的副本是又編譯器建立和銷毀的,所以不需要預設的建構函式和解構函式。結構是實值型別,所以對結構變數所做的改變不會影響其的原值,而類是應用類型,改變其變數的值會改變其原值。申明結構用Struck關鍵字,申明類用class關鍵字,向方法傳遞結構是時是通過值傳遞的,而不是通過引用。與類不同,結構的執行個體化可以不使用New關鍵字。類可以實現介面。 2,
Time of Update: 2018-12-07
這兩個類是從網上找來的,修改了一下,改為自己所需要的,測試通過.壓縮後的檔案為.zip感覺還不錯,所以轉載一下與大家共用/// <summary> /// 壓縮檔 /// </summary>using System;using System.IO;using ICSharpCode.SharpZipLib.Checksums;using ICSharpCode.SharpZipLib.Zip;using
Time of Update: 2018-12-07
ASP.Net C#代碼處Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Sub Macro1()'C列Dim strC As String'D列Dim strD As String'找出的行數Dim intCount As IntegerintCount = 0'外層迴圈For i = 2 To 120 strC = "C" + Trim(Str(i)) For j = 2 To 800 strD = "D" + Trim(Str(j)) If Trim(Range(strC)) = Trim(Range(strD))
Time of Update: 2018-12-07
很簡單的畫圖板,用C#實現,功能尚未完成,測試一下download 最近實在是太忙了,課程設計一個接一個,去年編的畫圖板到現在都還沒改成,湊合一下吧! 作業系統:WindowsXp 開發平台:Microsoft .NET Framework1.1+Microsoft Visual Studio .NET 2003 開發語言:C# 一、 相關知識: 關於c#的繪圖原理: 1. 重繪概念:對於MS
Time of Update: 2018-12-07
----過程代碼(insert into比for c in效率高 )create or replace procedure p_hkb_test isbegin begin insert into hkb_test1 (USER_NAME, AGE, USER_ID) select a.user_name, a.age, a.user_id from hkb_test a; exception when others then rollback;
Time of Update: 2018-12-07
條款1:Improve Performance of C++ Codes (1) -- 使用初始化列表還是指派陳述式?繼續記錄:條款2:--------------------------------Q:何時會出現臨時對象以及如何消除臨時對象?A:為了使函數成功調用而進行隱式類型轉換以及函數返回對象時可能會出現臨時對象。對於前者,可以採取方法避免隱式類型轉換,對於後者,盡量配合編譯器的傳回值最佳化(RVO)來消除臨時對象。--------------------------------在<
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->// 使用擴充方法做public static string[] SplitExt(this string sourceString, string splitString){ List<string> arrayList = new List<string>();
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System.Runtime.InteropServices;public class IniFile{ private string path; public IniFile(string iniPath) { this.path = iniPath;
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
XmlDocument doc = new XmlDocument();XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "UTF-8", null);doc.AppendChild(dec);XmlElement root = doc.CreateElement("BookInfo");doc.AppendChild(root);XmlElement isbn = doc.CreateElement("ISBN");isbn.InnerT
Time of Update: 2018-12-07
C#
Time of Update: 2018-12-07
public static Image ReduceImage(string imageFile, int toWidth, int toHeight){ Image originalImage = GetImage(imageFile); if (toWidth <= 0 && toHeight <= 0) { return originalImage; } else if (toWidth > 0 &&am