Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void OnStart(string[] args)
- {
- MessageQueue msMq = null;
- JobModel j = new JobModel();
- msMq = new MessageQueue(queueRequestName);
- try
- {
- if (msMq != null)
- {
- msMq.Formatter = new XmlMessageFormatter(new Type[] { typeof(JobModel) });
- var message = (JobModel)msMq.BeginReceive();
- }
- }
- catch (MessageQueueException ee)
- {
- Console.Write(ee.ToString());
- }
- catch (Exception eee)
- {
- Console.Write(eee.ToString());
- }
- finally
- {
- msMq.Close();
- }
- }
Add Comment
Please, Sign In to add comment