1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Release CCM Counter

Discussion in 'Releases' started by VerTical, Dec 6, 2017.

Tags:
  1. VerTical

    VerTical Head Member Donator

    1,010
    1,227
    273
    Credits:
    2,894
    CCM Counter :VerTical:
    CCM Counter is created in 10 minutes with Visual Studio 2017 in vc#.

    Download: is attached.
    Virus Scan: not needed because i have add the source.

    features:
    • Members counter
    • Awesome design
    • Included source code
    • Good performance
    Image:
    [​IMG]
    Source:

    Code:
    using System;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Net;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace CCM_Counter_2
    {
        public partial class Counter : Form
        {
            [DllImportAttribute("user32.dll")]
            public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
    
            [DllImportAttribute("user32.dll")]
            public static extern bool ReleaseCapture();
    
            public String Count { get; set; } = "0";
    
            public Thread Run { get; set; }
    
            public Counter()
            {
                InitializeComponent();
    
                ButtonClose.Click += (Object Obj, EventArgs Event) =>
                {
                    this.Focus();
                    Application.Exit();
                    Run.Abort();
                };
    
                Grid.Paint += (Object Obj, PaintEventArgs Paint) =>
                {
                    using (Graphics G = Paint.Graphics)
                    {
                        G.DrawString(String.Format("CCM Counter - {0}", Environment.UserName),
                            this.Font, Brushes.Gainsboro, 0, 2);
                        G.Dispose();
                    }
                };
    
                Grid.MouseDown += (Object Obj, MouseEventArgs Mouse) =>
                {
                    if(Mouse.Button is MouseButtons.Left)
                    {
                        ReleaseCapture();
                        SendMessage(Handle, 0xA1, 0x2, 0);
                    }
                };
    
                Area.Paint += (Object Obj, PaintEventArgs Paint) =>
                {
                    using (Graphics G = Paint.Graphics)
                    {
                        G.DrawString(String.Format("Members: {0}", Count as String),
                            new Font("Segoe UI", 15F, FontStyle.Regular),
                            Brushes.Gainsboro, 10, 10);
                        G.Dispose();
                    }
                };
    
                CheckForIllegalCrossThreadCalls = false;
                Run = new Thread(new ThreadStart(() => {
                    do
                    {
                        MemberCounter();
                        Thread.Sleep(1000);
                        Area.Refresh();
                    }
                    while (true);
                }));
                Run.Start();
            }
    
            private void MemberCounter()
            {
                try
                {
                    using (WebClient Client = new WebClient())
                    {
                        var HTML = Client.DownloadString("https://cabconmodding.com/") as String;
                        int Position = HTML.IndexOf("<dl class=\"memberCount\">") + 46;
                        String MemberCount = HTML.Substring(Position, 20);
                        String Value = String.Join("", MemberCount.ToCharArray().Where(Char.IsDigit));
    
                        Count = (Value);
                    }
                }
                catch (Exception Error)
                {
                    Count = (Error.Message);
                }
            }
        }
    }
    

    VerTical.



     

    Attached Files:

    Last edited: Dec 8, 2017
  2. Freezee

    Freezee Moderator Staff Member

    171
    217
    143
    Credits:
    1,049
    Why'd you use the dll's?, they weren't really needed. Other then maybe performance wise.
     
  3. VerTical

    VerTical Head Member Donator

    1,010
    1,227
    273
    Credits:
    2,894
    for this Please login or register to view links or downloads!
     
  4. Candy

    Candy G59 Terrorist Premium Member Donator

    711
    505
    278
    Credits:
    3,988
    lol, whats the point in this
     
    DF_AUS likes this.
  5. VerTical

    VerTical Head Member Donator

    1,010
    1,227
    273
    Credits:
    2,894
    lol, i was bored m8
     

Share This Page