2013-04-16 102 views

回答

3

這不是很漂亮,但我已經取得了一些成功使用此之前:

public static bool IsMsmqInstalled 
{ 
    get 
    { 
     try 
     { 
      IntPtr result = NativeMethods.LoadLibrary("Mqrt.dll"); 
      return (result != IntPtr.Zero); 
     } 
     catch (Exception) 
     { 
      return false; 
     } 
    } 
} 

public sealed class NativeMethods 
{ 
    [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)] 
    internal static extern IntPtr LoadLibrary(string lpFileName); 
} 
相關問題