Add linux download url

This commit is contained in:
2dust
2024-08-27 13:06:39 +08:00
parent 6f3e4b3682
commit 43753b1b7a
9 changed files with 90 additions and 98 deletions
+17
View File
@@ -33,6 +33,22 @@ namespace ServiceLib.Common
}
}
public static void UncompressedFile(string fileName, string toPath, string? toName)
{
try
{
FileInfo fileInfo = new(fileName);
using FileStream originalFileStream = fileInfo.OpenRead();
using FileStream decompressedFileStream = File.Create(toName != null ? Path.Combine(toPath, toName) : toPath);
using GZipStream decompressionStream = new(originalFileStream, CompressionMode.Decompress);
decompressionStream.CopyTo(decompressedFileStream);
}
catch (Exception ex)
{
Logging.SaveLog(ex.Message, ex);
}
}
public static string NonExclusiveReadAllText(string path)
{
return NonExclusiveReadAllText(path, Encoding.Default);
@@ -99,5 +115,6 @@ namespace ServiceLib.Common
}
return true;
}
}
}