Created
August 11, 2010 13:17
-
-
Save steefjan/518955 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Event Handler for Send button click | |
/// </summary> | |
/// <param name="sender"></param> | |
/// <param name="e"></param> | |
private void btnSend_Click(object sender, EventArgs e) | |
{ | |
//create an instance MessageQueue, which points to the already existing SalesForceCustomer | |
MessageQueue mq = new MessageQueue(@".\PRIVATE$\SalesForceCustomer"); | |
//Create instance Message | |
System.Messaging.Message mes = new System.Messaging.Message(); | |
//Instantiated encoding object | |
UTF8Encoding encoding = new UTF8Encoding(); | |
Byte[] byteArray = encoding.GetBytes(txtAccountDetails.Text); | |
MemoryStream mem = new MemoryStream(byteArray); | |
BinaryWriter writer = new BinaryWriter(mem); | |
mes.BodyStream = writer.BaseStream; | |
mq.Send(mes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment