Comment detail

コマンドライン引数の取得 (Nested Flatten)

This comment is reply for 5006 あにす: 方法1はcと同じ方法です。自身のパスを含...(コマンドライン引数の取得). Go to thread root.

方法2、方法3が題意に反するので訂正します。方法2から引数のみを得るのは難しいです。方法3を修正したコードを投稿します。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
//http://ja.doukaku.org/118/ 投稿用
using System;
class Program {
    static void Main(string[] args) {
        for(int i = 1; i < System.Environment.GetCommandLineArgs().Length; i++) {
            Console.WriteLine(System.Environment.GetCommandLineArgs()[i]);
        }
        Console.ReadLine();
    }
}

Index

Feed

Other

Link

Pathtraq

loading...