Announcement

Collapse
No announcement yet.

Bug in C#???

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in C#???

    Ich habe ein Problem mit
    if (! File.exists(Application.ExecutablePath+"Test.txt))
    {
    //Anweisung
    }
    Mache ich da etwas Falsch?Habe vorher mit Delphi Programmiert und kenne Extractfilepath!!!Existiert dass auch in C#???
    MFG Dirk

  • #2
    Hallo,

    ein Bug ist das nicht, denn <B>ExecutablePath</b> verhält sich so wie dokumentiert. Wenn man nur das Verzeichnis der ausführbaren Datei haben möchte, ist statt dessen <b>StartupPath</b> ("<i>Gets the path for the executable file that started the application, not including the executable name</i>")angesagt:
    <pre>
    <b>string</b> sFileName = Application.StartupPath + @<font color="#9933CC">&quot;\XMLData.xml&quot;</font>;
    <b>if</b> (File.Exists(sFileName))
    {
    MessageBox.Show(sFileName);
    }
    </pre&gt

    Comment


    • #3
      Sorry dass ich mich erst jetzt melde war nämlich im Urlaub!!!Vielen Dank Herr Kosch!!!
      PS:Ihre Bücher kenne ich schon seit Delphi 2

      Comment

      Working...
      X