使用命名参数:"变量:传入的参数"进行无序传参
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disorder_parameters
{
/// <summary>
/// 使用:"变量:传入的参数"进行无序传参
/// 尹永贤
/// 2015-4-27 19:28:05
/// yinyongxian@qq.com
/// </summary>
class Program
{
static void Main(string[] args)
{
string parameter0 = "parameter0";
string parameter1 = "parameter1";
string parameter2 = "parameter2";
Program p = new Program();
p.DisplayParameters(parameter1Value: parameter1, parameter2Value: parameter2, parameter0Value: parameter0);
Console.ReadKey();
}
public void DisplayParameters(string parameter0Value,string parameter1Value,string parameter2Value)
{
Console.WriteLine(parameter0Value);
Console.WriteLine(parameter1Value);
Console.WriteLine(parameter2Value);
}
}
}