2013-03-05 22 views
-1
private void buttonSend_Click(object sender, EventArgs e) 
{ 
    InsertChatDetails(); 
    //textBoxChat.Text += System.DateTime.Now.ToLongTimeString() + "" + System.Environment.GetEnvironmentVariable("Computername") + Environment.NewLine; 
    textBoxChat.Text += textBoxMessage.Text + Environment.NewLine; 
    textBoxMessage.Text = ""; 
} 

public void InsertChatDetails()              //Inserting Values 
{ 
    try 
    { 
     CommonCS CommonSample1 = new CommonCS(); 
     BusinessCS BFSample1 = new BusinessCS(); 

     CommonSample1.Id = "1"; 
     CommonSample1.FromUser = textBoxChat.Text += System.DateTime.Now.ToLongTimeString() + "-->" + Program.UserName + Environment.NewLine; 
     //CommonSample1.FromUser = textBoxChat.Text += System.DateTime.Now.ToLongTimeString() + "" + System.Environment.GetEnvironmentVariable("Computername") + Environment.NewLine; 
     CommonSample1.ToUser = ""; 
     CommonSample1.MessageText = textBoxMessage.Text; 
     CommonSample1.SentOn = DateTime.Now; 
     CommonSample1.StatusReport = 0; 
     BFSample1.InsertChatDetails(CommonSample1); 
    } 
    catch (Exception) 
    { 
    } 
} 
+0

我想通过邮件通知消息... – MaruthiRam 2013-03-05 09:21:46

回答

0

从代码中不确定你正在尝试做什么,但是如果它的同步可以在SendMessageToWinMachine()之后跟踪它,否则你可以使用CallBack方法进行异步调用。

相关问题