当前位置: 首页>>代码示例>>C#>>正文


C# MessageHandler.SendMessage方法代码示例

本文整理汇总了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);
 }
开发者ID:CaSimpson,项目名称:CourseHunterV2,代码行数:8,代码来源:viewProfile.aspx.cs

示例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");
    }
开发者ID:CliveCK,项目名称:WebSysME,代码行数:46,代码来源:SendMessage1.aspx.cs

示例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);

        }
    }
开发者ID:howleg,项目名称:up,代码行数:13,代码来源:ReadMail.aspx.cs


注:本文中的MessageHandler.SendMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。