mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
自动下载并更新
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
@@ -103,5 +104,19 @@ namespace Netch.Utils
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsZipValid(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var zipFile = ZipFile.OpenRead(path);
|
||||
_ = zipFile.Entries;
|
||||
return true;
|
||||
}
|
||||
catch (InvalidDataException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user