Esempio n. 1
0
        static bool SupportsAccessMode(string formatName, int accessType, out MsmqException msmqException)
        {
            msmqException = null;

            try
            {
                using (MsmqQueue msmqQueue = new MsmqQueue(formatName, accessType))
                {
                    msmqQueue.GetHandle();
                }
            }
            catch (Exception ex)
            {
                msmqException = ex as MsmqException;
                if (null != msmqException)
                {
                    return false;
                }
                throw;
            }
            return true;
        }
Esempio n. 2
0
 public static bool IsReadable(string formatName, out MsmqException ex)
 {
     return SupportsAccessMode(formatName, UnsafeNativeMethods.MQ_RECEIVE_ACCESS, out ex);
 }