Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3

Thread: C# Help

  1. #1
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default C# Help

    Hi,

    To get a better understanding of C#, I've started developing my own Habbo Retro Server (only for educational purposes).

    I've got all the basics completed and now I'm starting to develop the php side of the retro.

    I've decided to create a houskeeping system to go with the server and so this is why I need help.

    In the backend I am going to have a Packet send feature which just inserts specified packets into an SQL Table.

    I need help because I don't know how to keep running a function every 5 seconds or so (in C#). I need to run an SQL Query in C# every 5/10 seconds to check for any data in the SQL Table (and if there is, send the data).

    How would I go around repeating the function every 5 seconds?

    Thanks if you can help,
    -Simon

  2. #2
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    Try something along these lines:

    Code:
    Timer Clock;
      Label lbTime=new Label();
    
      public TimerDemo()
      {
        Clock=new Timer();
        Clock.Interval=1000;
        Clock.Start();
        Clock.Tick+=new EventHandler(*FUNCTION*);    }

    Just replace *FUNCTION* with the relevant function.

  3. #3
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    That looks to work,tbh simon not many people no C# here -i'd try a different forum - i'm only just learning it I wrote a calculator =DDDDD
    How could this hapen to meeeeeeeeeeeeeee?lol.

Posting Permissions

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