public bool ForgetPassword(string emailAddress) { try { var checkEmail = this._userContext.Users.Where(x => x.Email == emailAddress).FirstOrDefault(); if (checkEmail != null) { MSMQSender.SendMessage(); string body = MSMQReceiver.receiverMessage(); EmailService.Email(emailAddress, body); return(true); } return(false); } catch (Exception ex) { throw new Exception("Error in base64Encode" + ex.Message); } }
public static void Main() { MSMQReceiver msmqReceiver = new MSMQReceiver(); Console.WriteLine("** Please enter the queue path:"); Console.WriteLine(@"Example private queue path: ComputerName\PRIVATE$\QueueName "); Console.WriteLine(@"Example public queue path: ComputerName\QueueName "); string queuePath = Console.ReadLine(); try { if (!MessageQueue.Exists(queuePath)) { MessageQueue.Create(queuePath); Console.WriteLine("Queue created: " + queuePath); } using (MessageQueue messageQueue = new MessageQueue(queuePath)) { while (true) { Console.WriteLine(); Message msg = messageQueue.Receive(); msg.Formatter = new System.Messaging.XmlMessageFormatter(new Type[1] { typeof(string) }); Console.WriteLine("Message received: " + msg.Body); } } } catch (MessageQueueException) { Console.WriteLine("Message queue internal error."); } catch (InvalidOperationException e) { Console.WriteLine(e.Message); } Console.ReadKey(); }
//Receiver public void receiverAndCheckconnect() { AUOMQ.MSMQ.MSMQReceiver a = new MSMQReceiver(this, "192.168.222.135"); }