• C# Send Data Between Processes (w/ Memory Mapped File)

    If you’re reading this right now you’re probably developing some application that has 2 or more processes and you want those processes to share some data with each other. There are multiple ways to pass data between processes (IPC), each...


  • Call a C# Method from C/C++ (native process)

    So…I received a challenge from a friend (lost a bet…) regarding how to load a managed (C#) dll in a native (C++) process by using the Common Language Runtime (CLR). After a few tries, I came up with this…it seems...


  • C# Make a Critical Process (BSoD if Killed)

    A critical process is a type of process that Windows requires to be running - csrss.exe is an example of such process. Whenever a process like this finishes its execution (or it’s terminated) Windows will respond with an authentic Blue...


  • C# WebClient with Cookies

    Well, you’re probably reading this because you noticed that .NET’s WebClient doesn’t support cookies. Basically, the cookies which are received through the WebRequest are NOT stored and also NOT sent - this is how it works by default. How to...


  • C# Custom MSBuild Logger

    Here’s a short trick about how to make a custom MSBuild Logger. It’s always a good idea to use MSBuild with your own logger (and not the original one) because it provides easier access to the output log. So, I’ll...


  • C# Fix SimpleWorkerRequest Path Issue

    The problem If you ever tried to create an http server that can run ASP.NET code, you may know that you can only open pages from the root directory. If you try to open a page, that is in a...


  • C# EventHandler with Arguments

    All the methods that are called by events require two arguments: object sender EventArgs e The event calls a method using those 2 parameters, so we can’t directly add a custom argument. If we have this code and we want...


  • C# String vs StringBuilder

    StringBuilder or String? Is there any difference? It is - and not only the name, when we talk about our program’s performance. I’ll start by explaining how each one works so you’ll understand why this and not that. String 1string...


  • C# Text to Speech

    Windows SAPI is a nice tool that comes with Windows that allows us to transform an input text into a speech. Ok, this is quite simple…takes only 3 lines of code, so not much explanation is needed. How to? Right...