Skip to content

C# Examples

  • Home
  • About C#
    • C# Interview Questions and Answers for .NET Developers
    • Learn C#: A Practical Path Through the Examples
  • All Posts
  • Bootstrap 5 Examples
  • Contact

C# .NET

A Generic Cache Manager in C# with MemoryCache

November 25, 2026June 22, 2014 by turgay

A small, thread-safe generic cache manager in C# built on MemoryCache from Microsoft.Extensions.Caching.Memory, with expiration, GetOrCreate and size limits.

Categories C# .NET, Caching Tags C#, caching, generic cache manager 2 Comments

Resize a Bitmap in C# with Good Quality and Correct Proportions

November 25, 2026June 22, 2014 by turgay

Resize an image in C# with System.Drawing at high quality, keep the aspect ratio, avoid gray edges and control JPEG quality when saving.

Categories C# .NET Tags C#, draw image, resize bitmap 2 Comments

Play MP3 and WAV Files in C#: SoundPlayer, NAudio and Media Player

November 25, 2026June 21, 2014 by turgay

Play WAV files with SoundPlayer and MP3 files with NAudio or Windows Media Player in C#, synchronously or in the background, and await the end.

Categories C# .NET, WinForms Tags asynchronous, C#, play mp3, play mp3 and wav files, play wav, synchronous 2 Comments

Sort ListView Items by Column in C# (WinForms)

November 25, 2026June 21, 2014 by turgay

Sort a WinForms ListView by the clicked column, toggle ascending and descending, and sort numbers and dates by value instead of as text.

Categories C# .NET Tags C#, datetime column sorting, listview, sort listview items by columns, sorting, winform control Leave a comment

Fast Bitmap Comparison in C# with LockBits and Span

November 25, 2026June 21, 2014 by turgay

Check whether two bitmaps have identical pixels in C#, hundreds of times faster than GetPixel, using LockBits and Span.SequenceEqual.

Categories C# .NET Tags bitmap, C#, comparison, fast, fast bitmap comparison 14 Comments
Older posts
Newer posts
← Previous Page1 … Page11 Page12 Page13 … Page17 Next →

Categories

Recent Posts

  • Select XML Nodes by Name or Attribute Value in C#
  • Binary Search Tree in C#: Add, Find, Remove and Traversals
  • Select, Insert, Update and Delete Data in an Access File with C#
  • C# Collections: Which One to Use and When
  • C# ArrayList vs Generic List: Examples and When to Use Each
  • About
  • Privacy Policy
  • Contact
© 2026 C# Examples