如何摆脱弹出窗口 - 此文件已在源编辑器之外进行了修改 [英] How do I get rid of the popup - This file has been modified outside of the source editor

查看:406
本文介绍了如何摆脱弹出窗口 - 此文件已在源编辑器之外进行了修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在读取data.txt中的所有数据,然后删除data.txt中的所有数据,但我在服务器上弹出了这个:

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:

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"));
        }

推荐答案

这是因为该文件包含在您的项目中。

右 - 单击解决方案资源管理器中的文件,然后选择从项目中排除
This is because the file is included in your project.
Right-click the file in the solution explorer and select "Exclude from project"


这篇关于如何摆脱弹出窗口 - 此文件已在源编辑器之外进行了修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆