Application.StartupPath Eigenschap

Definitie

Hiermee haalt u het pad op voor het uitvoerbare bestand dat de toepassing heeft gestart, niet inclusief de naam van het uitvoerbare bestand.

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

Waarde van eigenschap

Het pad voor het uitvoerbare bestand waarmee de toepassing is gestart.

Dit pad verschilt, afhankelijk van of de Windows Forms toepassing wordt geïmplementeerd met Behulp van ClickOnce. ClickOnce-toepassingen worden opgeslagen in een toepassingscache per gebruiker in de map C:\Documents and Settings\username . Zie Toegang tot lokale en externe gegevens in ClickOnce-toepassingen voor meer informatie.

Voorbeelden

In het volgende codevoorbeeld wordt deze eigenschap opgehaald en wordt de waarde ervan weergegeven in een tekstvak. In het voorbeeld moet een textBox1 formulier zijn geplaatst.

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

Van toepassing op