Пример #1
0
        Thread CreateThread(long id)
        {
            Thread t = new Thread(new ThreadStart(delegate
            {
                if (!completed)
                {
                    string res = PonyboxClient.LoadUser(name, passwordlist[id]);
                    if (res != "")
                    {
                        Console.WriteLine(name + " : " + passwordlist[id]);
                        completed = true;
                    }
                    else
                    {
                        current++;
                        if (current % 10 == 0)
                        {
                            labelprogress.Invoke((MethodInvoker) delegate
                            {
                                labelprogress.Text = current + " / " + passwordlist.Length + " (" + current * 100 / passwordlist.Length + "%)";
                            });
                        }
                        NextThread();
                    }
                }
            }));

            return(t);
        }
Пример #2
0
        public LoggerForm()
        {
            InitializeComponent();

            string         path = "";
            OpenFileDialog file = new OpenFileDialog();

            if (file.ShowDialog() == DialogResult.OK)
            {
                path = file.FileName;
            }
            else
            {
                Application.Exit();
            }

            DBConnectionManager cm = new DBConnectionManager(path, "OleDb");

            logger = new Logger(cm.GetAdapter("SELECT * FROM Messages"), cm.GetAdapter("SELECT * FROM Users"));

            LoginForm frm = new LoginForm();

            string res = "";

            do
            {
                frm.ShowDialog();

                res = PonyboxClient.LoadUser(frm.GetUser(), frm.GetPass());
            } while (res == "");

            initCB(res);
        }
Пример #3
0
        public PonyboxForm()
        {
            InitializeComponent();
            client = new PonyboxClient();


            LoginForm frm = new LoginForm();


            string res = "";

            do
            {
                frm.ShowDialog();

                res = PonyboxClient.LoadUser(frm.GetUser(), frm.GetPass());
            } while (res == "");
            client.LoadUser(res);

            /*
             * frm.ShowDialog();
             * client.SetUserData(int.Parse(frm.GetUser()), frm.GetPass());
             */

            client.LoadChatbox();
            client.Connect();

            client.BindForm(this);
            client.BindMessageListCallback("UpdateMessages");
            client.BindMessageInsertCallback("InsertMessage");
            client.BindChannelListCallback("UpdateChannels");

            client.RefreshChannelList();
            client.JoinChannel("general");
        }
Пример #4
0
        public void initCB(string json)
        {
            this.credentials = json;

            client = new PonyboxClient();
            client.LoadUser(json);
            client.LoadChatbox();

            client.MessageRecieved              += onMessageRecieved;
            client.MessagesRecieved             += onMessagesRecieved;
            client.ChannelJoined                += onChannelJoined;
            client.ChannelListRefreshed         += onChannelListRefreshed;
            client.SocketConnectionStateChanged += onSocketConnectionStateChanged;

            client.RefreshChannelList();
        }
Пример #5
0
        public PonyboxCommandForm()
        {
            InitializeComponent();

            client = new PonyboxClient();

            LoginForm frm = new LoginForm();

            string res = "";

            do
            {
                frm.ShowDialog();

                res = PonyboxClient.LoadUser(frm.GetUser(), frm.GetPass());
            } while (res == "");

            client.LoadUser(res);
            client.LoadChatbox();
        }