2013-04-16 77 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); 
} 
相关问题