This file contains hidden or 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
using System.Collections.Generic; | |
using System.Reflection; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
namespace ConsoleApp1 | |
{ | |
public class PropertyIgnoreSerializerContractResolver : DefaultContractResolver | |
{ | |
private readonly HashSet<string> _ignores; |
This file contains hidden or 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
using System; | |
using System.Security.Cryptography.X509Certificates; | |
namespace CertInstaller | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(@"Certificate Installer v1.0"); |
This file contains hidden or 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
DecodeJsonUnicodeBytes(const unicodeByteStr: String): String; | |
var | |
LJSONObject: TJSONValue; | |
begin | |
try | |
LJSONObject := TJSONObject.ParseJSONValue(TEncoding.UTF8.GetBytes('{"alias":"'+unicodeByteStr+'"}'), 0, true); | |
Result := LJSONObject.GetValue<String>('alias'); | |
finally | |
LJSONObject.Free; | |
end; |
This file contains hidden or 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
private static byte[] ReducePicture(string inputPath, int percentage, int quality = 75) | |
{ | |
using (var originalImage = Image.FromFile(inputPath)) | |
{ | |
var newWidth = originalImage.Width * percentage / 100; | |
var newHeight = originalImage.Height * percentage / 100; | |
using (var resizedImage = new Bitmap(newWidth, newHeight)) | |
{ | |
using (var graphics = Graphics.FromImage(resizedImage)) |
OlderNewer