This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Changes the file extension by moving it. | |
/// </summary> | |
/// <param name="filePath">Full path to the file for which change the extension.</param> | |
/// <param name="extension">The new file extension.</param> | |
/// <returns>The path to the file, with the new extension.</returns> | |
private string ChangeFileExtension(string filePath, string extension) | |
{ | |
if (!extension.StartsWith(".")) | |
extension = "." + extension; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string FormatFileSize(long value, string format = null) | |
{ | |
var multipliers = new string[] { "o", "Kio", "Mio" }; | |
var midx = 0; | |
while ((Math.Abs(value) >= 1024) && (midx < multipliers.Length)) | |
{ | |
value /= 1000; | |
++midx; | |
} |
NewerOlder