会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
のんきネコ
博客园
首页
新随笔
联系
订阅
管理
2012年12月19日
C# 扩展方法注意事项
摘要: 扩展方法注意事项扩展方法所在的类必须是静态类。扩展方法必须是静态方法。扩展方法需要接受一个自身的参数:this。下面是具体的一个例子:class Program { static void Main(string[] args) { string str = "string"; int i = str.str2int();//调用 Console.WriteLine(i); Console.ReadLine(); } } //扩展方法所在的类必须是...
阅读全文
posted @ 2012-12-19 18:00 のんきネコ
阅读(219)
评论(0)
推荐(0)
编辑
公告