コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #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 static void Main()
        {
            Tuple <string, string> token  = LoginClient.Login("Nacle", "10judge02");
            PonyboxClient          client = new PonyboxClient();

            client.Connect(token);
            Console.ReadLine();
        }
コード例 #5
0
        public void initCB(string json, long count)
        {
            clients = new PonyboxClient[count];

            for (long i = 0; i < count; i++)
            {
                clients[i] = new PonyboxClient();
                //clients[i].LoadUser(json);
                clients[i].LoadChatbox(false);
                clients[i].SocketConnectionStateChanged += onSocketConnectionStateChanged;
            }
        }
コード例 #6
0
        public void Startup()
        {
            
            LoginView v = new LoginView();
            v.ShowDialog();
            Tuple<string, string> token = v.data;

            this.client = new PonyboxClient();
            this.client.OnChannelJoinedCallback = (c) => UpdateMessages(c);
            this.client.OnMessagesUpdatedCallback = (c) => UpdateMessages(c);

            this.client.Connect(token);
        }
コード例 #7
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();
        }
コード例 #8
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();
        }