bloxstrap/Bloxstrap/Utilities.cs
pizzaboxer 0a7ae17473
Consolidate stuff
yea
2023-07-02 21:41:45 +01:00

30 lines
791 B
C#

using System;
using System.Diagnostics;
using System.IO;
namespace Bloxstrap
{
static class Utilities
{
public static long GetFreeDiskSpace(string path)
{
foreach (DriveInfo drive in DriveInfo.GetDrives())
{
if (path.StartsWith(drive.Name))
return drive.AvailableFreeSpace;
}
return -1;
}
public static void ShellExecute(string website) => Process.Start(new ProcessStartInfo { FileName = website, UseShellExecute = true });
public static int VersionToNumber(string version)
{
// yes this is kinda stupid lol
version = version.Replace("v", "").Replace(".", "");
return Int32.Parse(version);
}
}
}