Skip to content

Instantly share code, notes, and snippets.

View sachintha81's full-sized avatar

Sach sachintha81

View GitHub Profile
@sachintha81
sachintha81 / MainWindow.xaml.cs
Last active March 6, 2023 20:31
WPF Progress Bar in a separate Window
using System;
using System.ComponentModel;
using System.Threading;
using System.Windows;
namespace WPFProgressBar
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
@sachintha81
sachintha81 / TrueRandomNumbers.cs
Created January 30, 2017 22:28
C# True (almost) Random Number Generator
//The following sample uses the Cryptography class to simulate the roll of a dice.
using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;
class RNGCSP
{
private static RNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider();