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
// Ref: https://stackoverflow.com/questions/19776716/c-sharp-windows-service-creates-process-but-doesnt-executes-it | |
[SuppressUnmanagedCodeSecurity] | |
public class ProcessHandler | |
{ | |
public const int GENERIC_ALL_ACCESS = 0x10000000; | |
//public const int CREATE_NO_WINDOW = 0x08000000; | |
public const int STARTF_USESHOWWINDOW = 0x00000001; | |
public const int SE_PRIVILEGE_ENABLED = 0x00000002; | |
public const string SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege"; |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
const string REG_KEY_IMAGE_PATH = "ImagePath"; | |
string env = string.Empty; | |
var hostBuilder = new HostBuilder() | |
.ConfigureAppConfiguration((hostContext, config) => | |
{ |
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
using CsvHelper; | |
using Jaeger; | |
using Jaeger.Samplers; | |
using OpenTracing; | |
using OpenTracing.Tag; | |
using OpenTracing.Util; | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; |
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
CefSharp Version | VC++ Redist Version | .Net Framework Version | |
---|---|---|---|
65.0.0 and above | 2015 | 4.5.2 | |
51.0.0 to 63.0.0 | 2013 | 4.5.2 | |
45.0.0 to 49.0.0 | 2013 | 4.0.0 | |
43.0.0 and below | 2012 | 4.0.0 |
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
public partial class DemoForm : Form | |
{ | |
public ChromiumWebBrowser ChromeBrowser; | |
// the target resource uri for browser rendering | |
private readonly string _address; | |
public DemoForm(string address) | |
{ | |
_address = address; |
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 class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
// passing uri resource from arugment | |
var address = !string.IsNullOrEmpty(args[0]) ? args[0] : "file:///xxxFolder//Error.html"; |
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
private static IDatabase _db; | |
private static ConnectionMultiplexer _connection; | |
// create connection to redis instance | |
// ... | |
public void BatchPushListRight(string key, IEnumerable<string> values, int expiredSeconds = 300) | |
{ | |
var batch = _db.CreateBatch(); | |
List<Task> tasks = new List<Task>(); |
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
// Copy source blob to destination blob | |
// Source file path might looks like: root_folder/sub_folder/.../source.txt for exmaple | |
public void SyncSourceBlobToDestBlob (string sourceConnString, string destConnString, string sourceFilePath, string prefixSource = "", string prefixTarget = "") | |
{ | |
try | |
{ | |
// initial source blob client resource | |
CloudStorageAccount.TryParse sourceConnString, out var sourceStorageAccount); | |
var sourceBlobClient = sourceStorageAccount..CreateCloudBlobClient(); | |
var sourceBlobContainer = sourceBlobClient.GetContainerReference("Your source blob name"); |
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
class Program | |
{ | |
static void Main (string[] args) | |
{ | |
// suppose we have collection that filled of source file(s) path | |
var sources = List<string>() | |
{ | |
"root/text/demo1.txt", | |
"root/text/demo2.txt", | |
"root/text/demo3.txt", |
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
// Dto class for object mapping to excel template | |
class ReportDto | |
{ | |
public string ParentItem { get; set; } | |
public string Description { get; set; } | |
public string Branch { get; set; } | |
public IEnumerable<Record> Records { get; set; } | |
} | |
class Record |
OlderNewer