Add tags

Add tags to the following comment

方法1はcと同じ方法です。自身のパスを含まない引数の配列を取得します。エントリポイントでのみ使えます。 方法2は自身のパスを含んだ全ての引数を含む文字列を取得します。自分で分割しないとそれぞれの引数を得られません。 方法3は自身のパスを含んだ引数の配列を取得します。プログラム中どこでも使えます。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
using System;
class Program {
    static void Main(string[] args) {
        Console.WriteLine("方法1");
        foreach(string cmd in args) {
            Console.WriteLine(cmd);
        }

        Console.WriteLine("\n方法2");
        Console.WriteLine(System.Environment.CommandLine);

        Console.WriteLine("\n方法3");
        foreach(string cmd in System.Environment.GetCommandLineArgs()) {
            Console.WriteLine(cmd);
        }
        Console.ReadLine();
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...