Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C#
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hkjghkj1
    wrote on last edited by
    #1

    [Message Deleted]

    I T B 3 Replies Last reply
    0
    • H hkjghkj1

      [Message Deleted]

      I Offline
      I Offline
      Ian Shlasko
      wrote on last edited by
      #2

      To get the path of your executable: System.Reflection.Assembly.GetEntryAssembly().Location Then just get the directory with System.IO.Path.GetDirectoryName(), and use System.IO.Path.Combine() to tack on the PDF filename. (Better to use System.IO.Path than string parsing, to make sure it'll work regardless of the location... forward slashes / backslashes, etc)

      Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)

      1 Reply Last reply
      0
      • H hkjghkj1

        [Message Deleted]

        T Offline
        T Offline
        Tamer Oz
        wrote on last edited by
        #3

        Use the code below. Application.StartupPath gives you the path of executable

        Process.Start(Application.StartupPath + @"\sample.pdf");

        1 Reply Last reply
        0
        • H hkjghkj1

          [Message Deleted]

          B Offline
          B Offline
          Baeltazor
          wrote on last edited by
          #4

          Or you could try this: (assuming the PDF file will always be in the same directory as your application executable) Process.Start(Environment.CurrentDirectory + @"\file.pdf"); Hope this helps.

          Regards, Jason Pezzimenti.


          If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups