+ Reply to Thread
Results 1 to 10 of 10

Thread: AutoTyper(Spammer) In C#

  1. #1
    Learning Programmer Kierien will become famous soon enough Kierien will become famous soon enough Kierien's Avatar
    Join Date
    Jan 2009
    Posts
    32

    AutoTyper(Spammer) In C#

    Hey,

    This tut is extremely simple, a good one for C# beginners =)

    First create a new C# project by going to

    Code:
    File>New>C#>Windows Forms Application
    Then add 1 timer, 3 textboxes, and 2 buttons.

    First were gonna give your timer a code, double click on your timer and add this code

    Code:
    SendKeys.Send(textBox1.text);
    SendKeys.Send("{ENTER}");
    SendKeys.Send(textBox2.text);
    SendKeys.Send("{ENTER}");
    SendKeys.Send(textBox3.text);
    SendKeys.Send("{ENTER}");
    The SendKeys Function basically types out the text you specify.

    Now rename one of your buttons to "Start", and give it the following code

    Code:
    timer1.Enabled = true;
    This enabled the timer, which in return, starts spamming your text.

    Then rename another one to "Stop", and give it the code below

    Code:
    timer1.Enabled = false;
    This disables your times, which stops the spamming.

    And ur done =D

    How simple was that?

    Hope you learned a thing or two from this.

    ~kierien
    Last edited by Kierien; 01-31-2009 at 11:02 PM.

  2. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: AutoTyper(Spammer) In C#

    Not bad, perhaps a bit more explanation though? Newbs are not going to know what a timer does or what the SendKeys class is. Perhaps you should give more detail on these two things. Also, don't you need a timer_tick function before your timer1 will do anything?

  3. #3
    Learning Programmer Kierien will become famous soon enough Kierien will become famous soon enough Kierien's Avatar
    Join Date
    Jan 2009
    Posts
    32

    Re: AutoTyper(Spammer) In C#

    Quote Originally Posted by Jordan View Post
    Not bad, perhaps a bit more explanation though? Newbs are not going to know what a timer does or what the SendKeys class is. Perhaps you should give more detail on these two things. Also, don't you need a timer_tick function before your timer1 will do anything?
    Alright, will reedit to more detail, and no we dont need a timer_tick, because we already have our timer enabled and disabled via buttons.

    ~kierien

  4. #4
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: AutoTyper(Spammer) In C#

    You have misunderstood. Timer_Tick is the subroutine that runs whenever the timer ticks.

    All of this code:

    Code:
    SendKeys.Send(textBox1.text);
    SendKeys.Send("{ENTER}");
    SendKeys.Send(textBox2.text);
    SendKeys.Send("{ENTER}");
    SendKeys.Send(textBox3.text);
    SendKeys.Send("{ENTER}");
    ..is put within the timer_tick subroutine.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  5. #5
    Newbie wajouba is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    6

    Re: AutoTyper(Spammer) In C#

    ok, I'm very new, so should I attempt this or not, cause it looks like its incomplete or lacking info...?!


  6. #6
    Newbie wajouba is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    6

    Re: AutoTyper(Spammer) In C#

    I tried this, and got some errors at the end of each of the SendKeys.Send(textBox1.text);

    the error is:
    dosn't contain definition for text and no extension method text.

    Did I need a reference that I didn't use?! :S
    I don't get it sorry I'm new :$

  7. #7
    Learning Programmer Kierien will become famous soon enough Kierien will become famous soon enough Kierien's Avatar
    Join Date
    Jan 2009
    Posts
    32

    Re: AutoTyper(Spammer) In C#

    It's .Text, not .text

  8. #8
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    Re: AutoTyper(Spammer) In C#

    I think the IDE will correct that for you.

    What does this do?

    Code:
    SendKeys.Send(textBox1.text);
    Like Jordan said, newbs won't understand what this is doing.

    Code:
    Now rename one of your buttons to "Start"
    Why? I don't see anywhere in your code, you referencing the button that you want me to call "Start". So why should I?

    Alright, will reedit to more detail, and no we dont need a timer_tick, because we already have our timer enabled and disabled via buttons.
    Yes, you do need a timer_tick method. When you double click on a timer, one is created for you.
    "Whenever you remember, I'll be there/
    Remember how we reached that dream together" - Carrie Underwood

  9. #9
    Newbie wajouba is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    6

    Re: AutoTyper(Spammer) In C#

    yes its true im trying to figure out what its doing, but I guess tomorow mourning would be better... plus you are right .Text was the problem, I did it and I got stuck in the autospamer when I tried it...

  10. #10
    Learning Programmer Kierien will become famous soon enough Kierien will become famous soon enough Kierien's Avatar
    Join Date
    Jan 2009
    Posts
    32

    Re: AutoTyper(Spammer) In C#

    Quote Originally Posted by chili5 View Post
    I think the IDE will correct that for you.

    What does this do?

    Code:
    SendKeys.Send(textBox1.text);
    Like Jordan said, newbs won't understand what this is doing.

    Code:
    Now rename one of your buttons to "Start"
    Why? I don't see anywhere in your code, you referencing the button that you want me to call "Start". So why should I?



    Yes, you do need a timer_tick method. When you double click on a timer, one is created for you.
    First of all, i wanted to rename the button to "Start" so that things will look neater. Secondly, yes i know when i double click on a timer a timer_tick is created for me. But i was referring to Jordan's post on whether a timer_tick was needed before the timer would function. And yeah we would need one, but it's already created anyway.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts