I read some files in a directory and made some changes, and saved the files after change another folder at F:\BI\Out\ and keep the original files, but when I opened the new files I found that only one file is changed correctly and for the other files I found that the old words are replace by blank space not by the new words. Can anyone help me 
    string text = "";
    string[] files;

    private void Form1_Load(object sender, EventArgs e)
    {

        try
        {
            files = Directory.GetFiles(@"F:\BI\In\", "*.*", SearchOption.AllDirectories);
        }
        catch (IOException ex)
        {
            MessageBox.Show(ex.Message);
            this.Close();
        }
    }

    private void btnUpdate_Click(object sender, EventArgs e)
    {
        if (txtEtlPath.Text == "")
        {
            MessageBox.Show("Please Enter path");
            txtEtlPath.Focus();
        }

        else
        {

            foreach (string file in files)
            {
                if (System.IO.File.Exists(file))
                {
                    text = File.ReadAllText(file);
                    text = text.Replace("Company_Address", txtCompanyAddress.Text + "_BI");
                    text = text.Replace("Company_Name", txtCompanyName.Text.Trim() + "_BIDW");
                    text = text.Replace("C:\\BIfolder",cboDrive.Text + txtEtlPath.Text.Trim());
                     var outFilePath = @"F:\BI\Out\" + Path.GetFileName(file);
                     File.WriteAllText(outFilePath, text);
                }