Application.StartupPath 속성

정의

애플리케이션을 시작한 실행 파일의 경로(실행 파일 이름 제외)를 가져옵니다.

public:
 static property System::String ^ StartupPath { System::String ^ get(); };
public static string StartupPath { get; }
member this.StartupPath : string
Public Shared ReadOnly Property StartupPath As String

속성 값

String

애플리케이션을 시작한 실행 파일의 경로입니다.

이 경로는 Windows Forms 애플리케이션이 ClickOnce 사용하여 배포되는지 여부에 따라 달라집니다. ClickOnce 애플리케이션은 C:\Documents 및 설정\username 디렉터리의 사용자별 애플리케이션 캐시에 저장됩니다. 자세한 내용은 로컬 및 ClickOnce 애플리케이션의 원격 데이터 액세스합니다.

예제

다음 코드 예제에서는이 속성을 가져오고 텍스트 상자에 해당 값을 표시 합니다. 이 예제에서는 폼에 배치된 것이 textBox1 필요합니다.

private:
   void PrintStartupPath()
   {
      textBox1->Text = String::Concat( "The path for the executable file",
        " that started the application is: ", Application::StartupPath );
   }
private void PrintStartupPath() {
    textBox1.Text = "The path for the executable file that " +
       "started the application is: " +
       Application.StartupPath;
 }
Private Sub PrintStartupPath()
   textBox1.Text = "The path for the executable file that " & _
      "started the application is: " & _
      Application.StartupPath
End Sub

적용 대상