Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am reading all the data from "data.txt" and then deleting all the data from "data.txt" but I get this popup at the server:
This file has been modified outside of the source editor.  
Do you want to reload it?

How do I not receive the popup?
Here is my code:
C#
protected void Button2_Click(object sender, EventArgs e)
        {
            string lines = File.ReadAllText(Server.MapPath("~/data.txt"));
            TextBox2.Text = lines.ToString();
            File.Delete(Server.MapPath("~/data.txt"));
        }
Posted

1 solution

This is because the file is included in your project.
Right-click the file in the solution explorer and select "Exclude from project"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900