Upload new LibZNI
This commit is contained in:
parent
3ab400b0d0
commit
c5aac5438b
2 changed files with 23 additions and 2 deletions
15
Tools.cs
15
Tools.cs
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
[assembly: LibZNI.AutoUpdater("/job/Bot", "!os!.tar")]
|
||||
namespace LibZNI
|
||||
{
|
||||
public class Tools
|
||||
|
@ -14,6 +16,19 @@ namespace LibZNI
|
|||
return int.Parse(DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString());
|
||||
}
|
||||
|
||||
public static string GetOSShortID()
|
||||
{
|
||||
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
bool isMac = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
if (isWindows) return "windows";
|
||||
if (isLinux) return "linux";
|
||||
if (isMac) return "osx";
|
||||
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
public static string Hash2String(byte[] Hash)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue