!lvl!ohsen Admin
Posts : 531 Join date : 2012-06-22 Location : baNDare-lengeH
| Subject: creat remout 20/7/2012, 11:23 am | |
| Code: private void pv(object sender, agsXMPP.protocol.client.Message msg)//voide makhsuse residane mesage { if (base.InvokeRequired) { base.BeginInvoke(new agsXMPP.protocol.client.MessageHandler(pv), new object[] { sender, msg }); } else { textBox3.AppendText(msg.From.User +" : " + msg.Body +"\n"); // textboxe 3 mesage daryafti va ferestande ro ezafe kon comboBox1.Items.Add (msg.From.User+"@"+msg.From.Server+"/"+msg.From.Resource); } }
in void vase mesagaye daryafti hala ma bayad tu in void ye if mizarim ke age tu mesage folan pm bud folan karo kon maslan alan ye if mizaram ke age mesage havie kalame "slm" bud ye mesagebox neshun bde pas codamo be shekle zir minevisam
Code: private void pv(object sender, agsXMPP.protocol.client.Message msg)//voide makhsuse residane mesage { if (base.InvokeRequired) { base.BeginInvoke(new agsXMPP.protocol.client.MessageHandler(pv), new object[] { sender, msg }); } else { if (msg.Body.Contains("slm")) // in method vase horoofe kuchiko bozorg fargh ghael mishe yani slm ba SLM fargh dare methodesh binary hastesh { MessageBox.Show("to behem gofti salam"); } textBox3.AppendText(msg.From.User +" : " + msg.Body +"\n"); // textboxe 3 mesage daryafti va ferestande ro ezafe kon comboBox1.Items.Add (msg.From.User+"@"+msg.From.Server+"/"+msg.From.Resource); } }
in ye method bud vali ye moshkel dare ke beyne horoofe kuchik va bozorg fargh ghael mishe age in mozo vasatun moheme az kode paini usekon
Code: private void pv(object sender, agsXMPP.protocol.client.Message msg)//voide makhsuse residane mesage { if (base.InvokeRequired) { base.BeginInvoke(new agsXMPP.protocol.client.MessageHandler(pv), new object[] { sender, msg }); } else { if (msg.Body.IndexOf("bye", StringComparison.OrdinalIgnoreCase) >= 0) // agemikhay vase horuf fagh ghael nashe az in method use kon behesh migan comparemethde text dar moghabele comparemethode binary { MessageBox.Show("herrrriiiiiiiiiiii"); }
textBox3.AppendText(msg.From.User +" : " + msg.Body +"\n"); // textboxe 3 mesage daryafti va ferestande ro ezafe kon comboBox1.Items.Add (msg.From.User+"@"+msg.From.Server+"/"+msg.From.Resource); } }
omidavaram mozo ro gerefte bashi by reza-dracula
| |
|