Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
  • Loading branch information
ldqk committed Sep 17, 2021
1 parent c5a2d89 commit 0aeb53a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public static string ReadAllText(this FileStream stream, Encoding encoding, bool
public static void WriteAllText(this FileStream stream, string content, Encoding encoding, bool closeAfter = true)
{
var sw = new StreamWriter(stream, encoding);
stream.SetLength(0);
sw.Write(content);
if (closeAfter)
{
Expand All @@ -145,6 +146,7 @@ public static void WriteAllText(this FileStream stream, string content, Encoding
public static void WriteAllLines(this FileStream stream, IEnumerable<string> lines, Encoding encoding, bool closeAfter = true)
{
var sw = new StreamWriter(stream, encoding);
stream.SetLength(0);
foreach (var line in lines)
{
sw.WriteLine(line);
Expand Down Expand Up @@ -262,6 +264,7 @@ public static async Task<string> ReadAllTextAsync(this FileStream stream, Encodi
public static async Task WriteAllTextAsync(this FileStream stream, string content, Encoding encoding, bool closeAfter = true)
{
var sw = new StreamWriter(stream, encoding);
stream.SetLength(0);
await sw.WriteAsync(content).ConfigureAwait(false);
await sw.FlushAsync().ConfigureAwait(false);
if (closeAfter)
Expand Down Expand Up @@ -289,6 +292,7 @@ public static async Task WriteAllTextAsync(this FileStream stream, string conten
public static async Task WriteAllLinesAsync(this FileStream stream, IEnumerable<string> lines, Encoding encoding, bool closeAfter = true)
{
var sw = new StreamWriter(stream, encoding);
stream.SetLength(0);
foreach (var line in lines)
{
await sw.WriteLineAsync(line).ConfigureAwait(false);
Expand Down
6 changes: 3 additions & 3 deletions Masuit.Tools.Abstractions/Masuit.Tools.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet />
<Version>2.4.4.2</Version>
<Version>2.4.4.3</Version>
<Authors>懒得勤快</Authors>
<Description>Masuit.Tools基础公共库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,Excel简单导出,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载和FTP客户端,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展等常用封装。</Description>
<Copyright>懒得勤快,长空X</Copyright>
Expand All @@ -17,9 +17,9 @@
<RepositoryType>Github</RepositoryType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<FileVersion>2.4.4.2</FileVersion>
<FileVersion>2.4.4.3</FileVersion>
<Company>masuit.com</Company>
<AssemblyVersion>2.4.4.2</AssemblyVersion>
<AssemblyVersion>2.4.4.3</AssemblyVersion>
<PackageLicenseUrl>https://github.com/ldqk/Masuit.Tools/blob/master/LICENSE</PackageLicenseUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
6 changes: 3 additions & 3 deletions Masuit.Tools.Core/Masuit.Tools.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ github:https://github.com/ldqk/Masuit.Tools
<UserSecretsId>830c282f-f7c1-42be-8651-4cd06ac8e73f</UserSecretsId>
<RepositoryType>Github</RepositoryType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>2.4.4.2</Version>
<FileVersion>2.4.4.2</FileVersion>
<Version>2.4.4.3</Version>
<FileVersion>2.4.4.3</FileVersion>
<Company>masuit.com</Company>
<AssemblyVersion>2.4.4.2</AssemblyVersion>
<AssemblyVersion>2.4.4.3</AssemblyVersion>
<Authors>懒得勤快X</Authors>
<RepositoryUrl>https://github.com/ldqk/Masuit.Tools</RepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
Binary file modified Masuit.Tools.Net45/Properties/AssemblyInfo.cs
Binary file not shown.
2 changes: 1 addition & 1 deletion Masuit.Tools.Net45/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!--*-->
<id>Masuit.Tools.Net45</id>
<!--*-->
<version>2.4.4.2</version>
<version>2.4.4.3</version>
<title>Masuit.Tools</title>
<!--*-->
<authors>懒得勤快</authors>
Expand Down
Binary file modified Masuit.Tools/Properties/AssemblyInfo.cs
Binary file not shown.
2 changes: 1 addition & 1 deletion Masuit.Tools/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!--*-->
<id>Masuit.Tools.Net</id>
<!--*-->
<version>2.4.4.2</version>
<version>2.4.4.3</version>
<title>Masuit.Tools</title>
<!--*-->
<authors>懒得勤快</authors>
Expand Down

0 comments on commit 0aeb53a

Please sign in to comment.