当前位置: 首页 > news >正文

网站制作哪些公司制作西安百度推广竞价托管

网站制作哪些公司制作,西安百度推广竞价托管,做网站 推广,科技有限公司英文Action<>是.NET Framework中自带的泛型委托&#xff0c;可以接收一个或多个输入参数&#xff0c;但不返回任何参数&#xff0c;可传递至多16种不同类型的参数类型。在Linq的一些方法上使用的比较多。 1、Action泛型委托 .NET Framework为我们提供了多达16个参数的Action…

Action<>是.NET Framework中自带的泛型委托,可以接收一个或多个输入参数,但不返回任何参数,可传递至多16种不同类型的参数类型。在Linq的一些方法上使用的比较多。

 

1、Action泛型委托

.NET Framework为我们提供了多达16个参数的Action委托定义,对于常见的开发场景已经完全够用。

如下图,

示例说明:

Action<>:委托至少0个参数,至多16个参数,无返回值。

Action:表示无参,无返回值的委托。

Action :表示有传入参数int,string无返回值的委托。

Action:表示有传入参数int,string,bool无返回值的委托。

Action:表示有传入4个int型参数,无返回值的委托。

2、Action泛型委托的使用

Action泛型委托的使用方法,可以通过下面代码看一下,

例如,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ActionDemo
{class Program{static void Main(string[] args){// 无参数无返回值的委托Action action1 = new Action(ActionWithNoParaNoReturn);action1();Console.WriteLine("----------------------------");// 使用delegateAction action2 = delegate { Console.WriteLine("使用delegate"); };// 执行action2();Console.WriteLine("----------------------------");// 使用匿名委托Action action3 = () => { Console.WriteLine("匿名委托"); };action3();Console.WriteLine("----------------------------");// 有参数无返回值的委托Action<int> action4 = new Action<int>(ActionWithPara);action4(11);Console.WriteLine("----------------------------");// 使用delegateAction<int> action5 = delegate (int i) { Console.WriteLine($"使用delegate的委托,参数值是:{i}"); };action5(22);Console.WriteLine("----------------------------");// 使用匿名委托Action<string> action6 = (string s) => { Console.WriteLine($"使用匿名委托,参数值是:{s}"); };action6("C#");Console.WriteLine("----------------------------");// 多个参数无返回值的委托Action<int,string> action7 = new Action<int,string>(ActionWithMulitPara);action7(33, "Java");Console.WriteLine("----------------------------");// 使用delegateAction<int,int,string> action8 = delegate (int i1, int i2, string s) {Console.WriteLine($"三个参数的Action委托,参数1的值是:{i1},参数2的值是:{i2},参数3的值是:{s}");};action8(44, 55, "Python");Console.WriteLine("----------------------------");Action<int,int,string,string> action9 = (int i1,int i2, string s1,string s2) => {Console.WriteLine($"使用四个参数的委托,参数1的值是:{i1},参数2的值是:{i2},参数3的值是:{s1},参数4的值是:{s2}");};// 执行委托action9(66,77, "C","CJavaPy");Console.ReadKey();}static void ActionWithNoParaNoReturn(){Console.WriteLine("无参数无返回值的Action委托");}static void ActionWithPara(int i){Console.WriteLine($"有参数无返回值的委托,参数值是:{i}");}static void ActionWithMulitPara(int i,string s){Console.WriteLine($"有两个参数无返回值的委托,参数1的值是:{i},参数2的值是:{s}");}}
}

 

http://www.wooajung.com/news/33124.html

相关文章:

  • 南浔区住房城乡建设局网站朋友圈网络营销
  • win10wordpress环境搭建黄石seo
  • 用word文档做网站建站网站
  • 网站开发 翻译线上推广平台报价
  • 网站title如何写seo优化自学
  • 易企秀网站开发技术免费测试seo
  • 团购网站建设市场调研报告包括哪些内容
  • 深圳网站制作公司价位百度推广管家登录
  • 牛商网营销型网站多少钱网站推广费用
  • 陆良县住房和城乡建设局网站百度认证官网
  • 山西省建设厅招标网站网站seo视频教程
  • 深圳做网站网络公司有哪些营销策略都有哪些
  • wordpress相册插件下载seo优化工具推荐
  • wordpress仪表盘美化谷歌优化排名哪家强
  • 网站开发如何共用菜单栏2023第三波疫情已经到来了
  • 商务网站开发考题百度站长社区
  • 普陀专业做网站搜索网站排行榜
  • 可以上传资源的网站开发费用哈尔滨百度网站快速优化
  • 枣庄做网站公司宁波网站优化公司电话
  • 建设网站2013道路定额厦门seo小谢
  • 到哪里做网站三台网站seo
  • 沈阳做公司网站的公司企业培训课程分类
  • java做网站电话注册网站策划书模板
  • 输入一组基因做网络图的网站关于进一步优化
  • 服装批发网站国家市场监督管理总局官网
  • wap网站开发招聘sem推广计划
  • 仿一个网站百度业务范围
  • 做企业网站一般用什么服务器推广论坛有哪些
  • 网站代理维护培训网站排名
  • 中国建设银行官方网站沈阳教你如何快速建站