bitScry - Blog

C#

About this site

This is a blog to help me remember some of the coding challenges I’ve faced and hopefully help others out if they’re suffering the same problems.

Recent Posts
  • Adding a Sonoff Zigbee Dongle Plus P Router to Zigbee2MQTT
  • Configuring Raspberry Pi 5 with NVME Hat
  • Pass Through an iGPU to Frigate from Proxmox
  • Creating a Frigate VM on Proxmox
  • Enable Remote Root SSH Login
Tag Cloud

.NET .NET Core AAD API appsettings.json ASP.NET Core Authentication Authorization Azure Azure Active Directory Azure Function Azure Storage Blob Bootstrap C# Cloud Storage Console Application CSS CSV DataTable Dependency Injection Dictionary Docker Entity Framework Enum Extension HTML Image JavaScript jQuery JSON List MVC Newtonsoft Raspberry Pi RestSharp Serilog SQL Stored Procedure Stream Table Table Storage Web App Web Application WordPress

Copyright
Creative Commons License Any code within by is licensed under a Creative Commons Attribution 4.0 International License.
Programming

PGP Encryption and Decryption in C#

A while ago I knocked up a NuGet package called PgpCore which uses the BouncyCastle library to easily encrypt and decrypt files and streams. The code for the project is here and this post is mainly here to point anyone in need towards it as I had to fix a Read more…

By Shinigami, 7 years ago
Programming

Upper Case the First Letter of a String

This is a simple string extension for upper casing the first letter of a string, the code originally came from here.

By Shinigami, 7 years ago
Programming

User GeoLocation in ASP.NET Core

If you want to get the physical location of a user on your site there’s a couple of different methods that you can use, you can either use their IP address to get an approximate location or you can request a more accurate location from them using the HTML geolocation Read more…

By Shinigami, 7 years ago
Azure

Exporting an Azure SQL Databases Using .NET

It’s possible to export an Azure SQL database to a BACPAC file using the Azure portal and PowerShell among other methods but the documentation makes no mention of doing this directly in .NET, though happily this is also possible. The process detailed below triggers a database export to a specified Read more…

By Shinigami, 7 years ago
Programming

Thread Safe DataTable Inserts and SqlBulkCopy

As part of a project where I was running multiple threads making API calls like this I was making a stored procedure call to log the results to an SQL database for each result returned. This worked fine when a low number of threads was used but then started to Read more…

By Shinigami, 7 years ago
Programming

Cryptographically Secure Random String

I’ve been trying to generate unique referal codes composed of uppercase letters for a project and although it’s not really necessary I wanted to make these as cryptographically sound as possible so I could reuse the code later in a personal password generator project. Turns out it wasn’t as simple Read more…

By Shinigami, 7 years ago
Programming

Using NPM and Gulp in Visual Studio 2017

By default new Web Applications created in Visual Studio 2017 use Bower for managing external libraries such as jQuery and Bootstrap, however Bower is no longer best practice (and seemed a bit flaky in Visual Studio anyway) and so for new projects I now use npm for managing packages. Using Read more…

By Shinigami, 7 years ago
Programming

Uploading Files in ASP.NET Core from an MVC View

I’ve been working on creating a page for for the uploading of files to either a SQL database or Azure Blob storage which turned out to be much more complicated than initially expected. I managed to eventually piece together how to do this and the resulting demo project can be Read more…

By Shinigami, 7 years ago
Programming

Checking for CSV Column Headers in C#

Importing CSV files into a .NET object isn’t too tricky and for this I usually use CsvHelper. However, sometimes I need to import a CSV file and only extract a couple of columns from it and these columns aren’t always guaranteed to exist. In order to do this I use Read more…

By Shinigami, 7 years ago
Programming

Checking Object Equality in C#

If you want to check if one instance of a custom class is equal to another instance of it you need to override the Equals operator for the class and implement your own. The code below is based on the articles The Right Way to do Equality in C# and Read more…

By Shinigami, 7 years ago

Posts pagination

Previous 1 … 5 6 7 8 Next
  • About
  • Blog
  • Contact
  • Create your website with blocks
  • Sample Page
  • Sample Page
Hestia | Developed by ThemeIsle