Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在Windows Phone 8.1应用程序中删除文本文件中的行_C#_Windows Phone 8.1 - Fatal编程技术网

C# 如何在Windows Phone 8.1应用程序中删除文本文件中的行

C# 如何在Windows Phone 8.1应用程序中删除文本文件中的行,c#,windows-phone-8.1,C#,Windows Phone 8.1,我使用以下代码在我的应用程序中写入txt文件: StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; StorageFolder dataFolder = await local.CreateFolderAsync("DataFolder", CreationCollisionOption.OpenIfExists); using (StreamReader reader = new StreamRe

我使用以下代码在我的应用程序中写入txt文件:

StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFolder dataFolder = await local.CreateFolderAsync("DataFolder", CreationCollisionOption.OpenIfExists);
using (StreamReader reader = new StreamReader(stream))
{
    data = reader.ReadLine();      
}

如何从txt文件中删除第一行???

复制所有剩余的行。是否用于此单个命令?打开StreamReader,在第一行之后读取文件的所有行,关闭StreamReader,打开StreamWriter,写入所有已读取的行,确保从未读取第一行,或者放弃它,关闭StreamWriter。如果文件我有10000行,它将消耗大量时间。是否将其删除?你检查过了吗?