C#/WPF

[WPF] 프로그램 실행시 인수 전달

딸기우유중독 2025. 3. 11. 08:24

 

 

 

using System;

class Sample
{
    public static void Main()
    {
        Console.WriteLine();
        //  Invoke this sample with an arbitrary set of command line arguments.
        string[] arguments = Environment.GetCommandLineArgs();
        Console.WriteLine("GetCommandLineArgs: {0}", string.Join(", ", arguments));
    }
}

 

 


 

 

https://learn.microsoft.com/ko-kr/dotnet/api/system.environment.getcommandlineargs?view=net-7.0

 

Environment.GetCommandLineArgs 메서드 (System)

현재 프로세스에 대한 명령줄 인수가 포함된 문자열 배열을 반환합니다.

learn.microsoft.com

 

 

728x90