Skip to content

Instantly share code, notes, and snippets.

View cwschroeder's full-sized avatar

Christian Schröder cwschroeder

  • IB SCHROEDER
  • Richard-Wagner-Str. 40, 93133 Burglengenfeld
View GitHub Profile
@cwschroeder
cwschroeder / test.cs
Created December 23, 2019 15:29
ECC Zeug
void Main()
{
/*
. Seeding the random number generator... ok
. Generating key pair... ok (key size: 256 bits)
+ Public key: 0478758D742D29533E8ADFC95B7AA6071397473B0D567FEFE8D36C21958DAA22291E2CF4860C3754B39532E27C718FE68CE60E05CCA39F5F09DE29C9857ABC6B56
. Computing message hash... ok
+ Hash: 02F4CCF09D1F5740E28864C430F866B46B697646D376E7813D12B873DBE16CC6
. Signing message hash... ok (signature length = 71)
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OpenQA.Selenium;
@cwschroeder
cwschroeder / MQTT Client
Last active October 13, 2023 09:50
Example of a C# MQTT client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
@cwschroeder
cwschroeder / gist:9a3c4943d03baf389313
Created March 4, 2015 15:38
Generate machine key for license
public static string GetSystemInfo(string SoftwareName)
{
if (UseProcessorID == true)
SoftwareName += RunQuery("Processor", "ProcessorId");
if (UseBaseBoardProduct == true)
SoftwareName += RunQuery("BaseBoard", "Product");
@cwschroeder
cwschroeder / gist:1931069abbd14c83023d
Created February 9, 2015 04:31
MongoCsLinqpadExt
void Main()
{
// Write code to test your extensions here. Press F5 to compile and run.
var server = new MongoClient("mongodb://localhost").GetServer();
var databases = server.GetDatabaseNames();
var db = server.GetDatabase("DVSE");
db.GenerateClasses();
//var collection = db.GetCollection<DvseMeter>("DvseMeter");
}

README is empty

@cwschroeder
cwschroeder / AsyncTcpServer
Created December 30, 2013 07:40
Async await tcp server
public class AsyncServer {
private const int BufferSize = 4096;
private static bool ServerRunning = true;
private List<TcpClient> clients = new List<TcpClient>();
private PRMasterAutomation automation;
public AsyncServer()
{
InitializeComponent();
automation = new PRMasterAutomation();
@cwschroeder
cwschroeder / KrFakeFor7261.cs
Last active December 31, 2015 05:29
Fake KR data for user 7261
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
using System.Diagnostics;
using System.IO;
@cwschroeder
cwschroeder / gist:5899664
Created July 1, 2013 09:55
Read Excel file
private static void Read()
{
var fileName = string.Format(@"c:\temp\test.xlsx");
var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0;", fileName);
var adapter = new OleDbDataAdapter("SELECT * FROM [Tabelle1$]", connectionString);
var ds = new DataSet();
adapter.Fill(ds, "myDs");