Esempio n. 1
0
        public void answerCheck(string newsScript, string title)
        {
            string[] splitNewScript = newsScript.Split(' ');
            string   score          = "";

            int i  = 0;
            int ok = 0;
            int no = 0;

            for (i = 0; i < questionCount; i++)
            {
                if (questionWord[i].ToLower().Equals(splitNewScript[questionBox[i]].ToLower()))
                {
                    ok++;
                }
                else
                {
                    no++;
                }
            }

            MessageBox.Show(questionCount + "개 중에 " + ok + "개를 맞추셨습니다.");
            score = ok + " / " + questionCount;
            userFile uf = new userFile();

            uf.createScore(score, title);
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            userFile uf = new userFile();

            uf.createWordText(formWord, formMean);
            MessageBox.Show("등록 되었습니다.");
            this.Close();
        }
Esempio n. 3
0
        private void todayNewsList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            title = todayNewsList.Text;
            string url            = Convert.ToString(result[title]);
            string dictationCount = "";
            string script         = "";
            int    x = this.Left;
            int    y = this.Top;

            resultInput resultIn    = new resultInput();
            InputBox    inputbox    = new InputBox();
            bool        patternBool = false;

            userFile uf = new userFile();

            title = toAscii(title);

            string          mp3Url, content;
            DataSet         ds      = new DataSet();
            string          strConn = "Server=203.255.3.244;Database=testDB;Uid=root;Pwd=thsdydtjr2;";
            MySqlConnection conn    = new MySqlConnection(strConn);

            string           sql  = "SELECT content,mp3url FROM testTable where title=\"\'" + title + "\'\"";
            MySqlDataAdapter adpt = new MySqlDataAdapter(sql, conn);

            adpt.Fill(ds, "row");

            mp3Url  = "";
            content = "";
            foreach (DataRow r in ds.Tables[0].Rows)
            {
                mp3Url = (string)r["mp3url"];
                mp3Url = mp3Url.Substring(1, mp3Url.Length - 2);
                Console.WriteLine(mp3Url);
                content = (string)r["content"];
            }

            conn.Close();

            uf.mp3DownLoad(title, mp3Url);

            uf.createReadList(title, mp3Url);
            //script = uf.createScript(title);                // parsing 부분을 쓰레드를 추가하여, 백그라운드로 처리. 그 이후에 스피너를 보여준다.
            script = content.Substring(1, content.Length - 4);                                   // 스피너는 gif 혹은 다이렉트X 를 이용하여 만들어준다.

            string[] splitScript = script.Split(' ');

            int maxWordScript = splitScript.Length;

            bool checkSelectRange = false;

            tabControl1.SelectedIndex = 1;
            do
            {
                resultIn = inputbox.Show("몇개의 단어를 비우시겠습니까?\n 1-" + maxWordScript + " 안에서 선택해 주세요.", "딕테이션 1.0", "", x + 100, y + 100);

                if (!resultIn.getClickCheck())
                {
                    break;
                }

                string Pattern = @"^[0-9]*$";

                if (!Regex.IsMatch(resultIn.getTextResult(), Pattern))
                {
                    MessageBox.Show("숫자만 입력 가능합니다.");
                    patternBool = true;
                }
                else
                {
                    patternBool = false;
                }


                if (!patternBool)
                {
                    if (resultIn.getTextResult().Equals("") || resultIn.getTextResult().Equals("0"))
                    {
                        MessageBox.Show("0개를 비울 수는 없습니다.");
                        checkSelectRange = false;
                    }
                    else if (Int32.Parse(resultIn.getTextResult()) > maxWordScript)
                    {
                        MessageBox.Show("최대치를 벗어났습니다.");
                        checkSelectRange = false;
                    }
                    else
                    {
                        checkSelectRange = true;
                    }
                }
            } while (!checkSelectRange || patternBool);

            if (!resultIn.getClickCheck())
            {
                this.tabControl1.SelectedIndex = 0;
            }
            else
            {
                /*
                 * do
                 * {
                 *  dictationCount = Microsoft.VisualBasic.Interaction.InputBox("몇개의 단어를 비우시겠습니까?", "딕테이션 1.0", "", x, y);
                 *
                 *  //Console.Write(dictationCount.Equals(""));
                 *  if (dictationCount.Equals("0") || dictationCount.Equals(""))
                 *      MessageBox.Show("0개를 비울 수는 없습니다.");
                 *
                 * } while (dictationCount.Equals("0") || dictationCount.Equals(""));
                 */

                dictationCount = resultIn.getTextResult();
                script         = toolClass.createDictation(script, dictationCount);

                article.Text = script;
                article.Font = new Font(article.Font, FontStyle.Regular);

                uf.mp3Start(title);
                playStatus = true;
                fileOb     = uf.getFileDate();
                fileLength = uf.getCalcuratorLength();

                macTrackBar1.Maximum = (int)fileLength;
                timer1.Start();
            }
        }