using System.Threading;using System;using System.Runtime.Remoting.Messaging; //不要忘記該引用,AsyncResult(異布調用的結果) namespace SyncDelegate{ public delegate int BinaryOp(int x, int y); class Program { static void Main(string[] args) {
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EventDemo{ delegate void TemperatureChangedEventHandle(object sender, BoiledWaterEventArgs args); class Program { static void Main(string[] a
一個屬性或方法可以同時被abstract 和override 修飾嗎?我的一個同事這樣問我。我最初的反應是:“當然不可以”,但是事實上證明的確是可以一起修飾的。 對於這個問題,我認真的思考了下,這種方式雖然少見,但是卻是合法的甚至還有點意義。假設我們有一個非常大的,複雜的類型,讓我們叫他”Thingy”:abstract class Thingy{ public virtual string Name { get { return ""; }
----------------------------------------------------------------------查詢一張表第15行到30行資料----------------方法1select top 10 * from jobs where job_id not in (select top 5 job_id from jobs)--方法2select * from (select top 15 * from jobs where job_id
1 //讓類能在FOREACH迴圈中使用 2 public class students 3 { 4 int i = -1; 5 6 student[] stus ; 7 public students() { 8 stus = new student[2]{ new student("xx"),new student("wsenmin") }; 9 }10
類testThread Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;namespace testThread{ public class MessageSendEventArgs : EventArgs {
通過反射來擷取某個表單註冊過的事件namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Load += new EventHandler(Form1_Load1); this.Load