コード例 #1
0
ファイル: Form1.cs プロジェクト: thijsrijkers/Gitback
        private void Button17_Click(object sender, EventArgs e)
        {
            TextWriter txt = new StreamWriter(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link1.txt"));

            txt.Write(textBox8.Text);
            txt.Close();
            TextWriter txt2 = new StreamWriter(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link2.txt"));

            txt2.Write(textBox9.Text);
            txt2.Close();
            TextWriter txt3 = new StreamWriter(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link3.txt"));

            txt3.Write(textBox10.Text);
            txt3.Close();
            TextWriter txt4 = new StreamWriter(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link4.txt"));

            txt4.Write(textBox11.Text);
            txt4.Close();

            hll.Clear();

            hyperlinks link1 = new hyperlinks();

            link1.hyperlink_id = 1;
            string text = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link1.txt"));

            link1.hyperlink_name = text;
            link1.hyperlink_link = text;
            hll.Add(link1);

            hyperlinks link2 = new hyperlinks();

            link2.hyperlink_id = 2;
            string text2 = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link2.txt"));

            link2.hyperlink_name = text2;
            link2.hyperlink_link = text2;
            hll.Add(link2);

            hyperlinks link3 = new hyperlinks();

            link3.hyperlink_id = 3;
            string text3 = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link3.txt"));

            link3.hyperlink_name = text3;
            link3.hyperlink_link = text3;
            hll.Add(link3);

            hyperlinks link4 = new hyperlinks();

            link4.hyperlink_id = 4;
            string text4 = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link4.txt"));

            link4.hyperlink_name = text4;
            link4.hyperlink_link = text4;
            hll.Add(link4);

            panel13.Visible = false;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: thijsrijkers/Gitback
        public Form1()
        {
            InitializeComponent();
            string[] files = Directory.GetFiles(Path.Combine(Environment.CurrentDirectory, @"apploc\"));
            foreach (string file in files)
            {
                if (file == Path.Combine(Environment.CurrentDirectory, @"apploc\gitnameaccount.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\gitname.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\link1.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\link2.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\link3.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\link4.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\xp.txt") || file == Path.Combine(Environment.CurrentDirectory, @"apploc\level.txt"))
                {
                }
                else
                {
                    listBox1.Items.Add(Path.GetFileName(file));
                }
            }
            button8.FlatStyle = FlatStyle.Flat;
            button8.FlatAppearance.BorderColor        = BackColor;
            button8.FlatAppearance.MouseDownBackColor = Color.Transparent;
            button8.FlatAppearance.MouseOverBackColor = Color.Transparent;
            hll.Clear();
            if (File.Exists(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link1.txt")) && File.Exists(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link2.txt")) && File.Exists(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link3.txt")) && File.Exists(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link4.txt")))
            {
                hyperlinks link1 = new hyperlinks();

                link1.hyperlink_id = 1;
                string text = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link1.txt"));
                link1.hyperlink_name = text;
                link1.hyperlink_link = text;
                hll.Add(link1);

                hyperlinks link2 = new hyperlinks();
                link2.hyperlink_id = 2;
                string text2 = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link2.txt"));
                link2.hyperlink_name = text2;
                link2.hyperlink_link = text2;
                hll.Add(link2);

                hyperlinks link3 = new hyperlinks();
                link3.hyperlink_id = 3;
                string text3 = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link3.txt"));
                link3.hyperlink_name = text3;
                link3.hyperlink_link = text3;
                hll.Add(link3);

                hyperlinks link4 = new hyperlinks();
                link4.hyperlink_id = 4;
                string text4 = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "link4.txt"));
                link4.hyperlink_name = text4;
                link4.hyperlink_link = text4;
                hll.Add(link4);

                listBox2.DataSource    = hll;
                listBox2.DisplayMember = "hyperlink_name";
                listBox2.ValueMember   = "hyperlink_id";
            }

            if (File.Exists(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "gitnameaccount.txt")))
            {
                string texttext = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "gitnameaccount.txt"));
                textBox23.Text            = texttext;
                pictureBox1.ImageLocation = "https://avatars.githubusercontent.com/" + texttext + "";
                pictureBox1.SizeMode      = PictureBoxSizeMode.StretchImage;
            }

            if (File.Exists(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "gitname.txt")))
            {
                Console.WriteLine("File Existed in Map");
                string textsearch = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "gitname.txt"));
                textBox5.Text             = textsearch;
                pictureBox3.ImageLocation = "https://avatars.githubusercontent.com/" + textsearch + "";
                pictureBox3.SizeMode      = PictureBoxSizeMode.StretchImage;
            }

            string level = System.IO.File.ReadAllText(Path.Combine(Environment.CurrentDirectory, @"apploc\" + "level.txt"));

            xpcheck();
            textBox14.Text = level;

            panel8.Visible   = false;
            panel22.Visible  = false;
            panel24.Visible  = false;
            button2.Visible  = false;
            listBox1.Visible = false;
            panel12.Visible  = false;
            panel13.Visible  = false;
        }