Console.WriteLine("args [{0}] = [{1}]",i,args [i]) [英] Console.WriteLine("args[{0}]=[{1}]", i, args[i])
本文介绍了Console.WriteLine("args [{0}] = [{1}]",i,args [i])的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public class CommandLine
{
public static void Main(string[] args)
{
Console.WriteLine("Number of command line parameters={0}", args.Length);
Console.ReadKey();
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine("args[{0}]=[{1}]", i, args[i]);
}
}
}
任何人都可以简要解释一下代码中加粗的部分到底是做什么的吗?
Can any one briefly explain what exactly does the bolded part of the code do???
推荐答案
它返回通过"args"提供的每个参数...只需运行代码])
It returns every single parameter provided via "args"... Just run the code ;)
我只是希望这不是您的任务之一!
粗体部分是一个接一个地处理参数,然后将其打印出来,格式为...
args [0] =某物
args [1] =某物
....
必须非常清楚...一旦执行程序...或仅对其进行调试!
I just hope this is not one of your assignments!
The bold part is taking the arguments one by one and printing that off... in a format like...
args[0] = something
args[1] = something
....
Must be quite clear...once you execute the program... or just debug it!
这篇关于Console.WriteLine("args [{0}] = [{1}]",i,args [i])的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文