c# 匿名方法的小例子
时间:2023-06-05 01:22:45
// Create a handler for a click event.
button1.Click += delegate(System.Object o, System.EventArgs e)
{ System.Windows.Forms.MessageBox.Show("Click!"); };
// Create a delegate.
delegate void Del(int x);
// Instantiate the delegate using an anonymous method.
Del d = delegate(int k) { /* ... */ };
void StartThread()
{
System.Threading.Thread t1 = new System.Threading.Thread
(delegate()
{
System.Console.Write("Hello, ");
System.Console.WriteLine("World!");
});
t1.Start();
}
标签:c#,匿名方法
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Android应用中使用ViewPager和ViewPager指示器来制作Tab标签
2021-08-04 11:33:37
![](https://img.aspxhome.com/file/2023/8/138208_0s.jpg)
Android TagCloudView云标签的使用方法
2023-03-28 14:29:20
![](https://img.aspxhome.com/file/2023/3/138653_0s.gif)
java设计模式之工厂方法模式
2022-08-29 05:14:10
![](https://img.aspxhome.com/file/2023/3/66543_0s.jpg)
Android操作存放在assets文件夹下SQLite数据库的方法
2023-12-13 21:00:26
详解Java中数组判断元素存在几种方式比较
2021-09-25 13:49:21
手把手教你搞懂冒泡排序和选择排序
2022-05-08 23:08:34
![](https://img.aspxhome.com/file/2023/2/100352_0s.png)
Android自定义View之自定义评价打分控件RatingBar实现自定义星星大小和间距
2023-03-14 04:30:16
![](https://img.aspxhome.com/file/2023/1/137141_0s.jpg)
WPF中的ListBox实现按块显示元素的方法
2021-06-11 03:39:03
android 大图片拖拽并缩放实现原理
2022-11-10 05:59:55
![](https://img.aspxhome.com/file/2023/6/100596_0s.png)
自定义Android圆形进度条(附源码)
2023-09-09 22:54:57
![](https://img.aspxhome.com/file/2023/1/138791_0s.png)
使用 BenchmarkDotNet 对 C# 代码进行基准测试
2023-06-25 00:38:49
![](https://img.aspxhome.com/file/2023/7/72487_0s.png)
Android webView字体突然变小的原因及解决
2022-01-02 23:39:08
一篇带你解析入门LongAdder源码
2023-11-28 20:17:52
![](https://img.aspxhome.com/file/2023/1/60401_0s.png)
Android点击WebView实现图片缩放及滑动浏览效果
2021-12-12 19:32:48
![](https://img.aspxhome.com/file/2023/7/138197_0s.jpg)
详解SpringBoot统一响应体解决方案
2023-03-08 08:54:13
Java使用Hutool实现AES、DES加密解密的方法
2021-06-03 16:49:57
Android自定义ImageView实现在图片上添加图层效果
2023-01-12 01:03:32
![](https://img.aspxhome.com/file/2023/6/130306_0s.jpg)
C#学习教程之Socket的简单使用
2022-09-07 18:15:04
![](https://img.aspxhome.com/file/2023/8/129748_0s.png)
java 流与 byte[] 的互转操作
2023-06-26 11:25:46
C#实现身份证验证功能的示例代码
2022-05-14 20:53:25
![](https://img.aspxhome.com/file/2023/6/106516_0s.png)