Iranian Programming Support

Welcome To Csharp TeaM Forum.
For Use All Forum Posts And See Links
Please Register
Thanks
www.Programming.MrForum.net
Csharp TeaM Administrator
Iranian Programming Support

Csharp TeaM

Top posting users this month

Latest topics

» html to c# source code convert help
by launchar Tue Dec 06, 2016 7:22 am

» User input
by nesraz Sun Dec 20, 2015 8:39 am

» darkhaste source mediaplayer baraye b4a
by parham01 Tue Dec 15, 2015 10:31 am

» Tolide esme file gheire tekrari
by sajjad3011 Fri Jul 31, 2015 5:00 pm

» 368 library basic 4 android
by alimusavi71 Fri Jul 17, 2015 6:45 pm

» نرم افزار دریافت لایسنس آنتی ویروس نود 32
by programmer-x Wed Jul 15, 2015 3:19 pm

» help for java applications
by launchar Wed Jul 01, 2015 12:25 am

» Nimbuzz id Maker auto Captcha & Auto add FlooD & id BloCker
by briant Sat Jun 20, 2015 12:46 pm

» best mobile server v.1.0.0 persian edition
by programmer-x Fri Jun 19, 2015 12:41 am

» plz help me i neez xml code for spy bot
by alone Sun Mar 22, 2015 9:30 pm

» Dialogs Lib {Basic 4 Android}
by abdo0o Mon Mar 09, 2015 4:02 pm

» Room + PV Flooder Nimbuzz 2015
by sholeh Sat Feb 21, 2015 8:06 am

» PV Flooder Nimbuzz 2015
by sholeh Sat Feb 21, 2015 8:03 am

» سی شارپ سورس
by tr0 Wed Dec 24, 2014 12:15 pm

» help plz auto maker ids
by launchar Wed Dec 17, 2014 5:57 pm

» Join Multi Id To Room + Captcha [ Badbuzz Team ] In Seri Ba AgsXMPP !!
by abdo0o Fri Dec 12, 2014 4:47 am

» Amoozesh Ersale Sms Dar B4a
by abdo0o Fri Dec 12, 2014 4:43 am

» help me pls mehran brother
by launchar Wed Dec 03, 2014 6:36 pm

» plz help code Refresh captcha join Room
by ayad53 Wed Dec 03, 2014 12:24 pm

» please Help Me For AutoCaptchaa kardan IdMaker
by abdo0o Tue Dec 02, 2014 12:12 pm

» source C# bot addlist sender by ==> Alone_051@n.c
by walahazrat Mon Dec 01, 2014 2:34 am

» s2a sender tro help me pls
by walahazrat Mon Dec 01, 2014 2:28 am

» Help For {Data id } C# asixmpp.dll
by abdo0o Sun Nov 30, 2014 11:17 pm

» Help C# {Join & Left With Remoter}
by $iahi Tue Nov 25, 2014 10:31 am

» Source Nimbuzz User Searcher By Mehr,an [ Badbuzz TeaM ]
by waseemmalik Wed Nov 19, 2014 11:35 am


    Help in message repeat filter c#

    Share
    avatar
    zaira
    Junior Member
    Junior Member

    Posts : 70
    Points : 106
    Thanks : 0
    Join date : 2014-06-16

    Open Help in message repeat filter c#

    Post by zaira on Fri Jul 11, 2014 11:11 am

    salam c# team OK 

    Please help in making message repeat filter  PARDON 
    avatar
    Mehran Mahmoudi
    Administrator
    Administrator

    Posts : 485
    Points : 780
    Thanks : 194
    Join date : 2013-09-06
    Age : 19
    Location : Iran , Qazvin , Qazvin

    Open Re: Help in message repeat filter c#

    Post by Mehran Mahmoudi on Fri Jul 11, 2014 11:29 am

    [You must be registered and logged in to see this link.]






    Anjomane Barname Nevisane Basic4Android
    __

    [You must be registered and logged in to see this link.]

    avatar
    desiboy
    Junior Member
    Junior Member

    Posts : 55
    Points : 81
    Thanks : 4
    Join date : 2013-08-26
    Age : 26
    Location : Kabul

    Open Re: Help in message repeat filter c#

    Post by desiboy on Sat Jul 12, 2014 8:24 am

    dash miran , hadafash ine ke masalan kase 3 bar hi begad to room , ban beshe

    ban by same message
    avatar
    zaira
    Junior Member
    Junior Member

    Posts : 70
    Points : 106
    Thanks : 0
    Join date : 2014-06-16

    Open Re: Help in message repeat filter c#

    Post by zaira on Sat Jul 12, 2014 8:32 am

    desiboy wrote:dash miran , hadafash ine ke masalan kase 3 bar hi begad to room , ban beshe

    ban by same message

    i want to do what rahmani@desiboy told HELP 
    avatar
    Mehran Mahmoudi
    Administrator
    Administrator

    Posts : 485
    Points : 780
    Thanks : 194
    Join date : 2013-09-06
    Age : 19
    Location : Iran , Qazvin , Qazvin

    Open Re: Help in message repeat filter c#

    Post by Mehran Mahmoudi on Sun Jul 13, 2014 2:18 am

    Code:
    timer1.Interval = 5000;
    timer1.Enabled = true;
    Timer1_Tick:
    Code:
    listBox1.Items.Clear();
    OnMessage :
    Code:
    if(msg.Type==MessageType.groupchat)
    {
    listBox1.Items.Add(msg.From.Resource+"@"+msg.Body);
    if(isBan(msg.From.Resource,msg.Body) == true)
    {
                                agsXMPP.protocol.x.muc.MucManager mucManager = new agsXMPP.protocol.x.muc.MucManager(x);
                                mucManager.BanUser(new Jid(msg.From.Bare), new Jid(msg.From.Resource + "@nimbuzz.com"));
    }
    }
    isBan:
    Code:
    bool isBan(string user,string body)
            {
                if (listBox1.Items.Count > 0)
                {
                    List<string> userMsgs = new List<string>();
                    for (int i = 0; i < listBox1.Items.Count; i++)
                        if ((listBox1.Items[i] as string).ToLower().StartsWith(user.ToLower()))
                        {
                          userMsgs.Add((listBox1.Items[i] as string).Substring((listBox1.Items[i] as string).Index("@")+1));
                        }
                    int index = 0;
                    for(int j = 0;j < userMsgs.Count;j++)
                        if(userMsgs[j].ToLower() == body.ToLower())
                          index++;
                    if (index > 3)
                        return true;
                    else
                        return false;
                }
                return false;
            }
    Test it. i dont have time to test






    Anjomane Barname Nevisane Basic4Android
    __

    [You must be registered and logged in to see this link.]

    avatar
    zaira
    Junior Member
    Junior Member

    Posts : 70
    Points : 106
    Thanks : 0
    Join date : 2014-06-16

    Open Re: Help in message repeat filter c#

    Post by zaira on Sun Jul 13, 2014 5:00 am

    meran thank you for the code

    there is a error in it

    i have solved it by replacing
    line

    Code:
    userMsgs.Add((listBox1.Items[i] as string).Substring((listBox1.Items[i] as string).Index("@")+1));

    with
    Code:
    userMsgs.Add((listBox3.Items[i] as string).Substring((listBox3.Items[i] as string).IndexOf("@") + 1));


    Can you tell me how to set this limit by numericUpDown?

    suppose the value in numericUpDown is 5.then if a user send same message 6 times he gets ban?
    avatar
    Mehran Mahmoudi
    Administrator
    Administrator

    Posts : 485
    Points : 780
    Thanks : 194
    Join date : 2013-09-06
    Age : 19
    Location : Iran , Qazvin , Qazvin

    Open Re: Help in message repeat filter c#

    Post by Mehran Mahmoudi on Sun Jul 13, 2014 5:20 am

    Place your code in here -->
    Code:
                    if (index > 3)
                        return true;
                    else
                        return false;
    Replace with this:
    Code:
     if (index > (numericUpDown.Value as int))






    Anjomane Barname Nevisane Basic4Android
    __

    [You must be registered and logged in to see this link.]

    avatar
    zaira
    Junior Member
    Junior Member

    Posts : 70
    Points : 106
    Thanks : 0
    Join date : 2014-06-16

    Open Re: Help in message repeat filter c#

    Post by zaira on Sun Jul 13, 2014 7:06 am

    This gives error
    Code:
    if (index > (numericUpDown.Value as int))

    use
    Code:
    Convert.ToInt32(numericUpDown.Value);

    code
    Code:
    if (index > Convert.ToInt32(numericUpDown5.Value))

    Sponsored content

    Open Re: Help in message repeat filter c#

    Post by Sponsored content


      Current date/time is Fri Aug 18, 2017 9:47 am