只展示部分說明性代碼取系統的硬碟分區的盤符,用API函數:GetDriveType [DllImport("kernel32.dll", EntryPoint="GetDriveType")]public static extern int GetDriveType (string nDrive);調用:string [] dirs = Environment.GetLogicalDrives(); //取得所有的盤符foreach(string dir in dirs){ if (
在昨天的隨筆裡:兩個硬碟和檔案相關的小技巧 中對於取得硬碟的分區列表使用了API,在靈感之源的提醒下,聯想到用WMI來實現,現在已經成功了,感謝靈感之源提供的思路以下是範例程式碼:先要引用System.Management.dll,using System.Management;SelectQuery query = new SelectQuery("SELECT * FROM Win32_LogicalDisk WHERE DriveType = 3");
在這裡,作者收集了現有的其他語言的.net實現,實在是想不到竟然有這麼多的語言在向.net移植,除了C#,basic,C++,Java,Javascript外,還包括名聲比較大的Python,PHP,Perl,Smalltalk,pascal,ada,tcl,Lisp,新貴lua,Ruby,還有一些聽都沒聽過的語言,而且一半以上的語言都有不止一個實現,甚至連C也在和.net套近乎,前兩年說的.net大潮真的一點也不為過。.NET LanguagesOne of the most
自從學了編程,音樂這個最大的愛好也放棄了,業餘時間幾乎都是在看書,想想這些東西都漸漸的遠去快變成回憶了,在我的blog裡,The Cure這支我最喜歡的樂隊的我最喜歡的專輯《BloodFlowers》裡最喜歡的歌《Last Day Of Summer》作為了blog的標題,不由想重溫下。可以在這裡聽到正張專輯:Bloodflowers 專輯封面 樂隊
可能的情況有:從一個類繼承,從一個或多個介面繼承,從一個類和一個或多個介面繼承。使用Type類的BaseType屬性來取得類從哪個類繼承。GetInterfaces方法來取得類都實現了哪些介面。測試代碼如下:類庫代碼:using System;namespace GetInterface{ public class Class1 : Class2,BaseInterface,BaseInterface1 { public Class1() { } public void aaa(
Principles behind the Agile ManifestoWe follow these principles: Our highest priority is to satisfy the customerthrough early and continuous deliveryof valuable software. Welcome changing requirements, even late in development. Agile processes