Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If any PDF capable app is properly installed then <code>System.Diagnostics.Process.Start(@"C:\MyPDF.pdf");</code> start it with your PDF file...</p> <p>As for detection you can check the registry at <code>HKLM\SOFTWARE\Adobe...</code> for the Reader and/or Acrobat.</p> <p>Another option would be to check for registered file association - on how check this SO answer <a href="https://stackoverflow.com/questions/212906/script-to-associate-an-extension-to-a-program/212921#212921">Script to associate an extension to a program</a></p> <p><strong>EDIT - as per comment:</strong></p> <p>For a scenario where you need to "dynamically" use Interop adding the reference statically is not a good idea... an alternative way is to do COM the "old-fashoined way" using something similar to the following:</p> <pre><code>object A = Activator.CreateInstance (Type.GetTypeFromProgId ("")); object R = Type.GetTypeFromProgId ("").InvokeMember ("MyMethodName", BindingFlags.InvokeMethod, null, A, new object[] {myParam1, myParam2}); Marshal.FinalReleaseComObject (A); </code></pre> <p>Relevant links:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/wccyzw83.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/wccyzw83.aspx</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/hss5hw09.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/hss5hw09.aspx</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/66btctbe.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/66btctbe.aspx</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/system.reflection.bindingflags.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.reflection.bindingflags.aspx</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.finalreleasecomobject.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.finalreleasecomobject.aspx</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload