⚠️ This blog post was created with the help of AI tools. Yes, I used a bit of magic from language models to organize my thoughts and automate the boring parts, but the geeky fun and the πŸ€– in C# are 100% mine.

Hi!

I needed a quick way to generate QR codes in .NETβ€”no heavy dependencies, no complex setup, just something that works and that’s exactly why I built:

πŸ‘‰ ElBruno.QRCodeGenerator

An open-source, lightweight library to generate QR codes in multiple formats:

  • πŸ–₯️ ASCII (perfect for CLI tools)
  • πŸ–ΌοΈ Images (PNG/SVG)
  • πŸ”— Payloads (WiFi, URL, email, vCard)

🎬 Watch the video

I recorded a quick demo showing how everything works end-to-end πŸ‘‡


⚑ Getting started

The goal is simple: generate QR codes with minimal code.

Here’s a basic example from the repo:

using ElBruno.QRCodeGenerator.CLI;

// Simplest possible usage
QRCode.Print("https://github.com/elbruno");

That’s it. You already have a QR code printed directly in your terminal πŸ‘‡
Perfect for CLI tools or quick debugging scenarios.


🧠 Working with Payloads

You can also generate real-world QR codes, not just plain text.

For example, WiFi credentials and more:

using ElBruno.QRCodeGenerator.Payloads;

// WiFi network QR code
var wifi = PayloadBuilder.Wifi("MyNetwork", "MyPassword123");
Console.WriteLine(wifi.GetPayloadString());
// Output: WIFI:T:WPA;S:MyNetwork;P:MyPassword123;;

// vCard contact
var vcard = PayloadBuilder.VCard("Bruno Capuano")
    .WithPhone("+1234567890", VCardPhoneType.Mobile)
    .WithEmail("bruno@example.com", VCardEmailType.Work)
    .WithOrganization("Contoso");
Console.WriteLine(vcard.GetPayloadString());

// Combine with any renderer (e.g., CLI)
QRCode.Print(wifi.GetPayloadString());

Other supported payloads:

  • πŸ“Ά WiFi
  • πŸ“§ Email
  • πŸ”— URLs
  • πŸ‘€ vCard (contacts)

πŸ’‘ Final thoughts

This project started as a fun experiment (with a bit of Copilot help 😎) and ended up being a super handy tool for day-to-day dev work.

πŸ‘‰ Repo: https://github.com/elbruno/ElBruno.QRCodeGenerator
πŸ‘‰ Video: https://youtu.be/op1dYj8Af6U

If you try it, let me know what you build! πŸš€

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.

More info in https://beacons.ai/elbruno


Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading