Introduction Recently I had an idea of a project which requires using the Bluetooth API. I wanted to create something simple and did not want to use UWP for 2 reasons:
I wanted to have a tray icon. This is also possible with UWP but creating a full-trust application seemed way more complicated for my scenario. I wanted a simple self-contained application which can run without the need of enabling developer mode for the end users....
Introduction One of the hardest things to explain to a beginner developer is delegate. It usually proves to be difficult because this piece of functionality’s use case is not obvious like variables, loops, collections etc.
In this blog post we will explore exactly what is that thing called a delegate, where do we use them in our daily work or even if it is that important, so…
What is a Delegate?...
ZipArchive’s interesting behavior Today I had an ordinary assignment. Generate an in memory .zip archive with one text file inside and send it to a web api. With C# this is straight-forward. Here is my oversimplified first attempt:
using var zipStream = new MemoryStream(); using var archive = new ZipArchive(zipStream, ZipArchiveMode.Create, true); var textFileEntry = archive.CreateEntry("Test.txt", CompressionLevel.Optimal); new MemoryStream(Encoding.UTF8.GetBytes("In memory file Content")) .CopyTo(textFileEntry.Open()); // Server sending logic The code above first creates a MemoryStream which represents the complete in memory zip archive....