コード例 #1
0
ファイル: Write.cs プロジェクト: karthik540/Pictionary
        private void Text_updater()
        {
            string directory = @"C:\PersonalData\" + details[0] + ".txt";
            string content   = Write_box.Text;

            string[] main_content = content.Split('`');
            for (int i = 0; i < main_content.Length; i++)
            {
                content = main_content[i] + Environment.NewLine;
                File.AppendAllText(directory, content);
            }
            Write_box.Text = "Successfully Updated \n Format : \nKeyword : Description or Meaning";
            Write_box.Update();
        }
コード例 #2
0
        private void Word_finder(string word)
        {
            string directory = @"C:\PersonalData\" + details[0] + ".txt";

            string[] content = File.ReadAllLines(directory);


            for (int i = 0; i < content.Length; i++)
            {
                string[] list = content[i].Split(':');
                if (list[0].Equals(word))
                {
                    display = list[1];
                }
            }
            Write_box.Text = display;
            Write_box.Update();
        }