本文整理汇总了C#中MessageHandler.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# MessageHandler.SendMessage方法的具体用法?C# MessageHandler.SendMessage怎么用?C# MessageHandler.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageHandler
的用法示例。
在下文中一共展示了MessageHandler.SendMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Send_Click
public void Send_Click(object sender, EventArgs e)
{
MessageHandler msgHandler = new MessageHandler();
if (!(String.IsNullOrEmpty(messageBox.Text)))
msgHandler.SendMessage(currentlyLoggedUserID, visitedUserId, "", Server.HtmlEncode(messageBox.Text));
messageBox.Text = string.Empty;
Response.Redirect(Request.RawUrl);
}
示例2: btnSend_Click
protected void btnSend_Click(object sender, EventArgs e)
{
if (txtToList.Text.Trim() == string.Empty)
{
//Set the notification label here
return;
}
// Let us get the list of valid users first
UserHandler userHandler = new UserHandler();
DataTable table = userHandler.GetUserList();
//Now get the recievers list entered by user
string recieversList = txtToList.Text.Replace(" ", "");
string[] users = recieversList.Split(new char[] { ','});
string[] failList = new string[users.Length];
string[] successList = new string[users.Length];
int successCount = 0;
int failCount = 0;
MessageHandler handler = new MessageHandler();
foreach (string user in users)
{
if (userHandler.IsValidUser(user) == true)
{
if (true == handler.SendMessage(user, CookiesWrapper.thisUserID.ToString(), txtSubject.Text, Server.HtmlEncode(FreeTextBox1.Text)))
{
successList[successCount++] = user;
}
else
{
failList[failCount++] = user;
}
}
else
{
failList[failCount++] = user;
}
}
Session["SuccessList"] = successList;
Session["FailList"] = failList;
Response.Redirect("Confirmation.aspx");
}
示例3: Send_Click
protected void Send_Click(object sender, EventArgs e)
{
String message = Server.HtmlEncode(messageBox.Text);
if (!(String.IsNullOrEmpty(message)))
{
MessageHandler msgHandler = new MessageHandler();
msgHandler.SendMessage(recieverID, senderID, "", Server.HtmlEncode(messageBox.Text));
messageBox.Text = string.Empty;
Response.Redirect(Request.RawUrl);
}
}