agha man ye chat box dorost kardam
pm barai tarf mire va pm to chat box neshon mide
vali pm tarf moghabelo neshon nemide
inam az code ke estefade mikonam
pm barai tarf mire va pm to chat box neshon mide
vali pm tarf moghabelo neshon nemide
inam az code ke estefade mikonam
- Code:
private void pv(object sender, agsXMPP.protocol.client.Message msg1)
{
if (InvokeRequired)
BeginInvoke(new agsXMPP.protocol.client.MessageHandler(remot), new object[] { sender, msg1 });
else
{
if (msg1.Type == MessageType.chat)
{
try
{
if (msg1.From.user.ToLower() == textBox1.Text)
{
richTextBox1.SelectionStart = richTextBox1.Text.Length;
richTextBox1.SelectionLength = 0;
richTextBox1.AppendText("\n");
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.AppendText(msg1.From.user + " : ");
richTextBox1.SelectionColor = Color.Violet;
try
{
richTextBox1.AppendText(msg1.Body);
}
catch { }
richTextBox1.AppendText("\r\n");
}
else if (msg1.From.user.ToLower() != textBox1.Text)
{
richTextBox1.SelectionStart = richTextBox1.Text.Length;
richTextBox1.SelectionLength = 0;
richTextBox1.AppendText("\n");
richTextBox1.SelectionColor = Color.Red;
richTextBox1.AppendText(msg1.From.user + " : ");
richTextBox1.SelectionColor = Color.Green;
try
{
richTextBox1.AppendText(msg1.Body);
}
catch { }
richTextBox1.AppendText("\r\n");
}
}
catch { }
}
}
}
- Code:
private void Sendpm_Click_1(object sender, EventArgs e)
{
if (!(textBox3.Text == Microsoft.VisualBasic.Constants.vbNullString))
{
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.SelectedText = textBox1 .Text +": ";
richTextBox1.SelectionColor = Color.Black;
richTextBox1.SelectedText = textBox3.Text + Environment.NewLine;
esi.Send("<message xmlns='jabber:client' to='" + textBox4.Text + "@nimbuzz.com' type='chat' id='424'><body>" + textBox3.Text + "</body><active xmlns='http://jabber.org/protocol/chatstates' /><x xmlns='jabber:x:event'><composing /></x><thread>PnzsiouWPeukRCGGXUoYodTItnnzbMxV</thread></message>");
textBox3.Clear();
}
}