Skip to content

Commit 6fa3f44

Browse files
committed
Merge branch 'master' of https://github.com/chr233/ASFEnhance
2 parents 303f3f9 + da68c94 commit 6fa3f44

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ASFEnhance/Other/Command.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ internal static class Command
216216
{
217217
try
218218
{
219-
using var file = File.Open(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
220-
using var writer = new StreamWriter(file, Encoding.UTF8);
221219
string result;
222220
try
223221
{
@@ -227,8 +225,7 @@ internal static class Command
227225
{
228226
result = string.Format("命令执行遇到内部错误: {0}, {1}", ex.Message, ex.StackTrace);
229227
}
230-
await writer.WriteAsync(result).ConfigureAwait(false);
231-
await writer.FlushAsync().ConfigureAwait(false);
228+
await File.WriteAllTextAsync(filePath, result).ConfigureAwait(false);
232229
}
233230
catch (Exception ex)
234231
{

0 commit comments

Comments
 (0)