私はこのコードを持っています:
public static void Main(string[] args)
{
if (string.IsNullOrEmpty(args[0])) // Warning : Index was out of the bounds of the array
{
ComputeNoParam cptern = new ComputeNoParam();
cptern.ComputeWithoutParameters();
}
else
{
ComputeParam cpter = new ComputeParam();
foreach (string s in args){...}
}
}
も試しif(args.Length==0)
ましたが、まだ機能しません。
基本的に、ユーザーが引数を指定してプログラムを呼び出したかどうかを調べたいと思います。そうでない場合、プログラムは入力を求めます。
これどうやってするの?前もって感謝します。