What happens is when the dialog comes up, if I press cancel it opens "c:\\text.txt"

How do i make it so that if i press cancel the program reads nothing (it reads "c:\\text.txt" right now)

SaveFileDialog

private void button38_Click(object sender, EventArgs e)
        {
            string l_text;
            string l_filename = "c:\\text.txt";

            SaveFileDialog fdlg = new SaveFileDialog();
            fdlg.Title = "My Xbox Live Bio Creation";
            fdlg.InitialDirectory = @"c:\";
            fdlg.Filter = "All Files.* (*.*)|*.*|Text Files.txt (*.txt)|*.txt";
            fdlg.FilterIndex = 2;
            fdlg.RestoreDirectory = true;
            if (fdlg.ShowDialog() == DialogResult.OK)
            {
               l_filename = fdlg.FileName;
            }

            if (textBox1.Text == "") l_text = " "; else l_text = textBox1.Text;
            if (textBox2.Text == "") l_text += " "; else l_text += textBox2.Text;
            if (textBox3.Text == "") l_text += " "; else l_text += textBox3.Text;
            if (textBox4.Text == "") l_text += " "; else l_text += textBox4.Text;
            if (textBox5.Text == "") l_text += " "; else l_text += textBox5.Text;
            if (textBox6.Text == "") l_text += " "; else l_text += textBox6.Text;
            if (textBox7.Text == "") l_text += " "; else l_text += textBox7.Text;
            if (textBox8.Text == "") l_text += " "; else l_text += textBox8.Text;
            if (textBox9.Text == "") l_text += " "; else l_text += textBox9.Text;
            if (textBox10.Text == "") l_text += " "; else l_text += textBox10.Text;
            if (textBox11.Text == "") l_text += " "; else l_text += textBox11.Text;
            if (textBox12.Text == "") l_text += " "; else l_text += textBox12.Text;
            if (textBox13.Text == "") l_text += " "; else l_text += textBox13.Text;
            if (textBox14.Text == "") l_text += " "; else l_text += textBox14.Text;
            if (textBox15.Text == "") l_text += " "; else l_text += textBox15.Text;
            if (textBox16.Text == "") l_text += " "; else l_text += textBox16.Text;
            if (textBox17.Text == "") l_text += " "; else l_text += textBox17.Text;
            if (textBox18.Text == "") l_text += " "; else l_text += textBox18.Text;
            if (textBox19.Text == "") l_text += " "; else l_text += textBox19.Text;
            if (textBox20.Text == "") l_text += " "; else l_text += textBox20.Text;
            if (textBox21.Text == "") l_text += " "; else l_text += textBox21.Text;
            if (textBox22.Text == "") l_text += " "; else l_text += textBox22.Text;
            if (textBox23.Text == "") l_text += " "; else l_text += textBox23.Text;
            if (textBox24.Text == "") l_text += " "; else l_text += textBox24.Text;
            if (textBox25.Text == "") l_text += " "; else l_text += textBox25.Text;
            if (textBox26.Text == "") l_text += " "; else l_text += textBox26.Text;
            if (textBox27.Text == "") l_text += " "; else l_text += textBox27.Text;
            if (textBox28.Text == "") l_text += " "; else l_text += textBox28.Text;
            if (textBox29.Text == "") l_text += " "; else l_text += textBox29.Text;
            if (textBox30.Text == "") l_text += " "; else l_text += textBox30.Text;
            if (textBox31.Text == "") l_text += " "; else l_text += textBox31.Text;
            if (textBox32.Text == "") l_text += " "; else l_text += textBox32.Text;
            if (textBox33.Text == "") l_text += " "; else l_text += textBox33.Text;
            if (textBox34.Text == "") l_text += " "; else l_text += textBox34.Text;
            if (textBox35.Text == "") l_text += " "; else l_text += textBox35.Text;
            if (textBox36.Text == "") l_text += " "; else l_text += textBox36.Text;
            if (textBox37.Text == "") l_text += " "; else l_text += textBox37.Text;
            if (textBox38.Text == "") l_text += " "; else l_text += textBox38.Text;
            if (textBox39.Text == "") l_text += " "; else l_text += textBox39.Text;
            if (textBox40.Text == "") l_text += " "; else l_text += textBox40.Text;
            if (textBox41.Text == "") l_text += " "; else l_text += textBox41.Text;
            if (textBox42.Text == "") l_text += " "; else l_text += textBox42.Text;
            if (textBox43.Text == "") l_text += " "; else l_text += textBox43.Text;
            if (textBox44.Text == "") l_text += " "; else l_text += textBox44.Text;
            if (textBox45.Text == "") l_text += " "; else l_text += textBox45.Text;
            if (textBox46.Text == "") l_text += " "; else l_text += textBox46.Text;
            if (textBox47.Text == "") l_text += " "; else l_text += textBox47.Text;
            if (textBox48.Text == "") l_text += " "; else l_text += textBox48.Text;
            if (textBox49.Text == "") l_text += " "; else l_text += textBox49.Text;
            if (textBox50.Text == "") l_text += " "; else l_text += textBox50.Text;
            if (textBox51.Text == "") l_text += " "; else l_text += textBox51.Text;
            if (textBox52.Text == "") l_text += " "; else l_text += textBox52.Text;
            if (textBox53.Text == "") l_text += " "; else l_text += textBox53.Text;
            if (textBox54.Text == "") l_text += " "; else l_text += textBox54.Text;
            if (textBox55.Text == "") l_text += " "; else l_text += textBox55.Text;
            if (textBox56.Text == "") l_text += " "; else l_text += textBox56.Text;
            if (textBox57.Text == "") l_text += " "; else l_text += textBox57.Text;
            if (textBox58.Text == "") l_text += " "; else l_text += textBox58.Text;
            if (textBox59.Text == "") l_text += " "; else l_text += textBox59.Text;
            if (textBox60.Text == "") l_text += " "; else l_text += textBox60.Text;
            if (textBox61.Text == "") l_text += " "; else l_text += textBox61.Text;
            if (textBox62.Text == "") l_text += " "; else l_text += textBox62.Text;
            if (textBox63.Text == "") l_text += " "; else l_text += textBox63.Text;
            if (textBox64.Text == "") l_text += " "; else l_text += textBox64.Text;
            if (textBox65.Text == "") l_text += " "; else l_text += textBox65.Text;
            if (textBox66.Text == "") l_text += " "; else l_text += textBox66.Text;
            if (textBox67.Text == "") l_text += " "; else l_text += textBox67.Text;
            if (textBox68.Text == "") l_text += " "; else l_text += textBox68.Text;
            if (textBox69.Text == "") l_text += " "; else l_text += textBox69.Text;
            if (textBox70.Text == "") l_text += " "; else l_text += textBox70.Text;
            if (textBox71.Text == "") l_text += " "; else l_text += textBox71.Text;
            if (textBox72.Text == "") l_text += " "; else l_text += textBox72.Text;
            if (textBox73.Text == "") l_text += " "; else l_text += textBox73.Text;
            if (textBox74.Text == "") l_text += " "; else l_text += textBox74.Text;
            if (textBox75.Text == "") l_text += " "; else l_text += textBox75.Text;
            if (textBox76.Text == "") l_text += " "; else l_text += textBox76.Text;
            if (textBox77.Text == "") l_text += " "; else l_text += textBox77.Text;
            if (textBox78.Text == "") l_text += " "; else l_text += textBox78.Text;
            if (textBox79.Text == "") l_text += " "; else l_text += textBox79.Text;
            if (textBox80.Text == "") l_text += " "; else l_text += textBox80.Text;
            if (textBox81.Text == "") l_text += " "; else l_text += textBox81.Text;
            if (textBox82.Text == "") l_text += " "; else l_text += textBox82.Text;
            if (textBox83.Text == "") l_text += " "; else l_text += textBox83.Text;
            if (textBox84.Text == "") l_text += " "; else l_text += textBox84.Text;
            if (textBox85.Text == "") l_text += " "; else l_text += textBox85.Text;
            if (textBox86.Text == "") l_text += " "; else l_text += textBox86.Text;
            if (textBox87.Text == "") l_text += " "; else l_text += textBox87.Text;
            if (textBox88.Text == "") l_text += " "; else l_text += textBox88.Text;
            if (textBox89.Text == "") l_text += " "; else l_text += textBox89.Text;
            if (textBox90.Text == "") l_text += " "; else l_text += textBox90.Text;
            if (textBox91.Text == "") l_text += " "; else l_text += textBox91.Text;
            if (textBox92.Text == "") l_text += " "; else l_text += textBox92.Text;
            if (textBox93.Text == "") l_text += " "; else l_text += textBox93.Text;
            if (textBox94.Text == "") l_text += " "; else l_text += textBox94.Text;
            if (textBox95.Text == "") l_text += " "; else l_text += textBox95.Text;
            if (textBox96.Text == "") l_text += " "; else l_text += textBox96.Text;
            if (textBox97.Text == "") l_text += " "; else l_text += textBox97.Text;
            if (textBox98.Text == "") l_text += " "; else l_text += textBox98.Text;
            if (textBox99.Text == "") l_text += " "; else l_text += textBox99.Text;
            if (textBox100.Text == "") l_text += " "; else l_text += textBox100.Text;
            if (textBox101.Text == "") l_text += " "; else l_text += textBox101.Text;
            if (textBox102.Text == "") l_text += " "; else l_text += textBox102.Text;
            if (textBox103.Text == "") l_text += " "; else l_text += textBox103.Text;
            if (textBox104.Text == "") l_text += " "; else l_text += textBox104.Text;
            if (textBox105.Text == "") l_text += " "; else l_text += textBox105.Text;
            if (textBox106.Text == "") l_text += " "; else l_text += textBox106.Text;
            if (textBox107.Text == "") l_text += " "; else l_text += textBox107.Text;
            if (textBox108.Text == "") l_text += " "; else l_text += textBox108.Text;
            if (textBox109.Text == "") l_text += " "; else l_text += textBox109.Text;
            if (textBox110.Text == "") l_text += " "; else l_text += textBox110.Text;
            if (textBox111.Text == "") l_text += " "; else l_text += textBox111.Text;
            if (textBox112.Text == "") l_text += " "; else l_text += textBox112.Text;
            if (textBox113.Text == "") l_text += " "; else l_text += textBox113.Text;
            if (textBox114.Text == "") l_text += " "; else l_text += textBox114.Text;
            if (textBox115.Text == "") l_text += " "; else l_text += textBox115.Text;
            if (textBox116.Text == "") l_text += " "; else l_text += textBox116.Text;
            if (textBox117.Text == "") l_text += " "; else l_text += textBox117.Text;
            if (textBox118.Text == "") l_text += " "; else l_text += textBox118.Text;
            if (textBox119.Text == "") l_text += " "; else l_text += textBox119.Text;
            if (textBox120.Text == "") l_text += " "; else l_text += textBox120.Text;
            if (textBox121.Text == "") l_text += " "; else l_text += textBox121.Text;
            if (textBox122.Text == "") l_text += " "; else l_text += textBox122.Text;
            if (textBox123.Text == "") l_text += " "; else l_text += textBox123.Text;
            if (textBox124.Text == "") l_text += " "; else l_text += textBox124.Text;
            if (textBox125.Text == "") l_text += " "; else l_text += textBox125.Text;
            if (textBox126.Text == "") l_text += " "; else l_text += textBox126.Text;
            if (textBox127.Text == "") l_text += " "; else l_text += textBox127.Text;
            if (textBox128.Text == "") l_text += " "; else l_text += textBox128.Text;
            if (textBox129.Text == "") l_text += " "; else l_text += textBox129.Text;
            if (textBox130.Text == "") l_text += " "; else l_text += textBox130.Text;
            if (textBox131.Text == "") l_text += " "; else l_text += textBox131.Text;
            if (textBox132.Text == "") l_text += " "; else l_text += textBox132.Text;
            if (textBox133.Text == "") l_text += " "; else l_text += textBox133.Text;
            if (textBox134.Text == "") l_text += " "; else l_text += textBox134.Text;
            if (textBox135.Text == "") l_text += " "; else l_text += textBox135.Text;
            if (textBox136.Text == "") l_text += " "; else l_text += textBox136.Text;
            if (textBox137.Text == "") l_text += " "; else l_text += textBox137.Text;
            if (textBox138.Text == "") l_text += " "; else l_text += textBox138.Text;
            if (textBox139.Text == "") l_text += " "; else l_text += textBox139.Text;
            if (textBox140.Text == "") l_text += " "; else l_text += textBox140.Text;
            if (textBox141.Text == "") l_text += " "; else l_text += textBox141.Text;
            if (textBox142.Text == "") l_text += " "; else l_text += textBox142.Text;
            if (textBox143.Text == "") l_text += " "; else l_text += textBox143.Text;
            if (textBox144.Text == "") l_text += " "; else l_text += textBox144.Text;
            if (textBox145.Text == "") l_text += " "; else l_text += textBox145.Text;
            if (textBox146.Text == "") l_text += " "; else l_text += textBox146.Text;
            if (textBox147.Text == "") l_text += " "; else l_text += textBox147.Text;
            if (textBox148.Text == "") l_text += " "; else l_text += textBox148.Text;
            if (textBox149.Text == "") l_text += " "; else l_text += textBox149.Text;
            if (textBox150.Text == "") l_text += " "; else l_text += textBox150.Text;
            if (textBox151.Text == "") l_text += " "; else l_text += textBox151.Text;
            if (textBox152.Text == "") l_text += " "; else l_text += textBox152.Text;
            if (textBox153.Text == "") l_text += " "; else l_text += textBox153.Text;
            if (textBox154.Text == "") l_text += " "; else l_text += textBox154.Text;
            if (textBox155.Text == "") l_text += " "; else l_text += textBox155.Text;
            if (textBox156.Text == "") l_text += " "; else l_text += textBox156.Text;
            if (textBox157.Text == "") l_text += " "; else l_text += textBox157.Text;
            if (textBox158.Text == "") l_text += " "; else l_text += textBox158.Text;
            if (textBox159.Text == "") l_text += " "; else l_text += textBox159.Text;
            if (textBox160.Text == "") l_text += " "; else l_text += textBox160.Text;
            if (textBox161.Text == "") l_text += " "; else l_text += textBox161.Text;
            if (textBox162.Text == "") l_text += " "; else l_text += textBox162.Text;
            if (textBox163.Text == "") l_text += " "; else l_text += textBox163.Text;
            if (textBox164.Text == "") l_text += " "; else l_text += textBox164.Text;
            if (textBox165.Text == "") l_text += " "; else l_text += textBox165.Text;
            if (textBox166.Text == "") l_text += " "; else l_text += textBox166.Text;
            if (textBox167.Text == "") l_text += " "; else l_text += textBox167.Text;
            if (textBox168.Text == "") l_text += " "; else l_text += textBox168.Text;
            if (textBox169.Text == "") l_text += " "; else l_text += textBox169.Text;
            if (textBox170.Text == "") l_text += " "; else l_text += textBox170.Text;

            System.IO.StreamWriter file = new System.IO.StreamWriter(l_filename);
            file.WriteLine(l_text);

            file.Close();

OpenFileDialog

private void button39_Click(object sender, EventArgs e)
        {
            string l_text;
            string l_filename = "c:\\text.txt";
            string s = System.IO.File.ReadAllText("c:\\text.txt");
            OpenFileDialog fdlg = new OpenFileDialog();
            fdlg.Title = "My Xbox Live Bio Creation";
            fdlg.InitialDirectory = @"c:\";
            fdlg.Filter = "All Files.* (*.*)|*.*|Text Files.txt (*.txt)|*.txt";
            fdlg.FilterIndex = 2;
            fdlg.RestoreDirectory = true;
            if (fdlg.ShowDialog() == DialogResult.OK)

            {
                l_filename = fdlg.FileName;

            }

 
            System.IO.StreamReader MyStreamReader = new System.IO.StreamReader (l_filename, System.Text.Encoding.Unicode);
            
            int ch;

          
            ch = MyStreamReader.Read(); textBox1.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox2.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox3.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox4.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox5.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox6.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox7.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox8.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox9.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox10.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox11.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox12.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox13.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox14.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox15.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox16.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox17.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox18.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox19.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox20.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox21.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox22.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox23.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox24.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox25.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox26.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox27.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox28.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox29.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox30.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox31.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox32.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox33.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox34.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox35.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox36.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox37.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox38.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox39.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox40.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox41.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox42.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox43.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox44.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox45.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox46.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox47.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox48.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox49.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox50.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox51.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox52.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox53.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox54.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox55.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox56.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox57.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox58.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox59.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox60.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox61.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox62.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox63.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox64.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox65.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox66.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox67.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox68.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox69.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox70.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox71.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox72.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox73.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox74.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox75.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox76.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox77.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox78.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox79.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox80.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox81.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox82.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox83.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox84.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox85.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox86.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox87.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox88.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox89.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox90.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox91.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox92.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox93.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox94.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox95.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox96.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox97.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox98.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox99.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox100.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox101.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox102.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox103.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox104.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox105.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox106.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox107.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox108.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox109.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox110.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox111.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox112.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox113.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox114.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox115.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox116.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox117.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox118.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox119.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox120.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox121.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox122.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox123.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox124.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox125.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox126.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox127.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox128.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox129.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox130.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox131.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox132.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox133.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox134.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox135.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox136.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox137.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox138.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox139.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox140.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox141.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox142.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox143.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox144.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox145.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox146.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox147.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox148.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox149.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox150.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox151.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox152.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox153.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox154.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox155.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox156.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox157.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox158.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox159.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox160.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox161.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox162.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox163.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox164.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox165.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox166.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox167.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox168.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox169.Text = ch.ToString();
            ch = MyStreamReader.Read(); textBox170.Text = ch.ToString();


            MyStreamReader.Close();

Recommended Answers

All 3 Replies

>Openfiledialog and Savefiledialog when i press cancel !

..
 DialogResult res = fdlg.ShowDialog();

if (res == DialogResult.Cancel)
 {
    return;
  }
..

Actually, if you use DialogResult.Cancel
you will trigger your metod when you only press cancel, it does not covers all cancel probabilities.
i.e. You can cancel the dialogbox by pressing X icon.

You should use DialogResult.OK. When user press Ok->> yes open that file else->> User canceled it

if (fileDialog1.ShowDialog() == DialogResult.OK)
{
// User pressed ok, run neccessary methods etc.
}
else 
{
// Console.WriteLine("User pressed cancel!");
}

Good advice, but 9 years too late.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.