委托简单实例
来源:互联网 发布:知乎成都最好的研究所 编辑:程序博客网 时间:2024/05/20 12:48
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace yufademo
{
class Program
{
delegate void getstring(string name);//定义委托
static void Main(string[] args)
{
getstring g = new getstring(M2);//委托关联方法
g("song");//用委托的形式来执行方法
Console.Read();
}
static void M2(string s1)//定义一个方法
{
Console.WriteLine(s1);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace yufademo
{
class Program
{
delegate void getstring(string name);//定义委托
static void Main(string[] args)
{
getstring g = new getstring(M2);//委托关联方法
g("song");//用委托的形式来执行方法
Console.Read();
}
static void M2(string s1)//定义一个方法
{
Console.WriteLine(s1);
}
}
}
- 简单的委托实例
- 委托简单实例
- delegate--- 委托简单的实例
- c# 委托类传值简单实例
- .NET-简单的委托实例
- 简单实例说明委托和事件。
- C#委托-马戏表演简单实例
- C#一个简单的委托实例
- C#中简单的委托实例
- 委托(委托实例化)
- 委托实例
- 委托实例
- c#中的委托和事件的简单实例_c#应用
- ASP.NET中"委托"(delegate)的使用简单实例
- vb.net中线程委托的简单实例
- 委托机制在线程中的使用的简单实例
- 章鱼哥出品_VB.NET 线程委托应用实例 一个简单的例子让你轻松掌握委托的用法
- 委托,事件实例(转摘)
- php-fpm的两种进程管理模式
- C语言程序设计字符串内容反转
- linux 系统条用 --- mount /umount 函数详解
- 在main方法中请求spring管理的service
- 抓狂的cassandra(3) —— 负载配置
- 委托简单实例
- javax.servlet.ServletException: java.lang.NullPointerException
- Project : error PRJ0019: 某个工具从以下位置返回了错误代码: "正在执行生成后事件...
- 如何让Qt程序只运行一次等
- pthread 相关
- iOS UITextView 与 Localizable.strings中的换行
- 10种世界上最美的花
- 解密module_init
- IOS 设置条件断点的方法