54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Server.Helper.Methods
|
|
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
|
|
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
|
|
|
|
using System;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
#nullable disable
|
|
namespace Server.Helper;
|
|
|
|
public static class Methods
|
|
{
|
|
private const string Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
public static Random Random = new Random();
|
|
|
|
public static string BytesToString(long byteCount)
|
|
{
|
|
string[] strArray = new string[7]
|
|
{
|
|
"B",
|
|
"KB",
|
|
"MB",
|
|
"GB",
|
|
"TB",
|
|
"PB",
|
|
"EB"
|
|
};
|
|
if (byteCount == 0L)
|
|
return "0" + strArray[0];
|
|
long a = Math.Abs(byteCount);
|
|
int int32 = Convert.ToInt32(Math.Floor(Math.Log((double) a, 1024.0)));
|
|
double num = Math.Round((double) a / Math.Pow(1024.0, (double) int32), 1);
|
|
return ((double) Math.Sign(byteCount) * num).ToString() + strArray[int32];
|
|
}
|
|
|
|
public static async Task FadeIn(Form o, int interval = 80 /*0x50*/)
|
|
{
|
|
for (; o.Opacity < 1.0; o.Opacity += 0.05)
|
|
await Task.Delay(interval);
|
|
}
|
|
|
|
public static string GetRandomString(int length)
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder(length);
|
|
for (int index = 0; index < length; ++index)
|
|
stringBuilder.Append("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[Methods.Random.Next("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".Length)]);
|
|
return stringBuilder.ToString();
|
|
}
|
|
}
|