what does it not allow me to use "using" here: private void btnGenerate_Click(object sender, EventArgs e)
        {
            string filename;
            string[] parts;
            string word1;
            string word2;
            string word3;
            int counter = 0;
            List<string> words = new List<string>();
            Random random = new Random();

            filename = txtfName.Text;
            try
            {
                //check if the file exists if not return a message
                if (File.Exists(filename))
                {
                    using StreamReader sr = new StreamReader(filename);
                    string line;
                    while (!sr.EndOfStream)
                    {
                        line = sr.ReadLine();
                        parts = line.Split(" ", StringSplitOptions.RemoveEmptyEntries);
                        foreach (string part in parts)
                        {
                            words.Add(part);
                        }

                    }
                    sr.Close();

                    int num = Convert.ToInt32(txtpassNum.Text);
                    //gets random words from the list and replaces the letters as required
                    for (int i = 0; i < num; i++)
                    {
                        word1 = words[random.Next(0, words.Count)];
                        word2 = words[random.Next(0, words.Count)];
                        word3 = words[random.Next(0, words.Count)];

                        word1 = word1.Replace("i", "!");
                        word1 = word1.Replace('s', '$');

                        word2 = word2.Replace("i", "!");
                        word2 = word2.Replace('s', '$');
                        word2 = word2.ToUpper();

                        word3 = word3.Replace("i", "!");
                        word3 = word3.Replace('s', '$');

                        string password = word1 + word2 + word3;

                        lisPass.Text = password;
                    }
                }
                else
                {
                    MessageBox.Show("This file does no exist.");
                }

            }
            catch (Exception ex)
            {
                Write("That number is invalid");
                Write(ex.Message);

            }private void btnGenerate_Click(object sender, EventArgs e)
        {
            string filename;
            string[] parts;
            string word1;
            string word2;
            string word3;
            int counter = 0;
            List<string> words = new List<string>();
            Random random = new Random();

            filename = txtfName.Text;
            try
            {
                //check if the file exists if not return a message
                if (File.Exists(filename))
                {
                    using StreamReader sr = new StreamReader(filename);
                    string line;
                    while (!sr.EndOfStream)
                    {
                        line = sr.ReadLine();
                        parts = line.Split(" ", StringSplitOptions.RemoveEmptyEntries);
                        foreach (string part in parts)
                        {
                            words.Add(part);
                        }

                    }
                    sr.Close();

                    int num = Convert.ToInt32(txtpassNum.Text);
                    //gets random words from the list and replaces the letters as required
                    for (int i = 0; i < num; i++)
                    {
                        word1 = words[random.Next(0, words.Count)];
                        word2 = words[random.Next(0, words.Count)];
                        word3 = words[random.Next(0, words.Count)];

                        word1 = word1.Replace("i", "!");
                        word1 = word1.Replace('s', '$');

                        word2 = word2.Replace("i", "!");
                        word2 = word2.Replace('s', '$');
                        word2 = word2.ToUpper();

                        word3 = word3.Replace("i", "!");
                        word3 = word3.Replace('s', '$');

                        string password = word1 + word2 + word3;

                        lisPass.Text = password;
                    }
                }
                else
                {
                    MessageBox.Show("This file does no exist.");
                }

            }
            catch (Exception ex)
            {
                Write("That number is invalid");
                Write(ex.Message);

            }