delegate 委託一例

2021-06-05 04:00:17 字數 428 閱讀 4023

using system;

using system.collections.generic;

using system.linq;

using system.text;

namespace consoletest

public static void englishgreeting(string sname)

public static void chinesegreeting(string sname)

//public enum language

////public void greetingpeople(string sname,language lang)

////}

static void main()}}

執行結果:

delegate 委託一例 3

using system using system.collections.generic using system.linq using system.text namespace consoletest 三角形 public static void calcarea int iwidth 高度 ...

初始delegate委託

剛剛接觸c 不足三個月,最近網上查了一下c 的delegate委託。發現delegate更類似於之前學習c語言時候的指標,可以呼叫其它方法。使用委託可以將方法作為引數來賦值和傳遞。1 定義委託 2public delegate void mytestdelegate int i 3 class pr...

委託Delegate使用幫助

using system using system.collections.generic using system.linq using system.text namespace 委託delegate 1,建立委託 public delegate void mydelegate string m...