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

Convert an Image to a Byte Array in C#

November 25, 2026September 2, 2014 by turgay

Turn a System.Drawing Image into a byte array in PNG, JPEG or its original format, and know when File.ReadAllBytes is the better answer.

Categories C# .NET, WinForms Tags C#, convert image, convert image to byte array, image to byte array 1 Comment

Convert a Byte Array to an Image in C#

November 25, 2026September 2, 2014 by turgay

Load an Image from a byte array in C# without the “generic error occurred in GDI+” trap, plus the WPF BitmapImage version.

Categories C# .NET, WinForms Tags byte array to image, C#, convert byte array, convert byte array to image 3 Comments

Bootstrap 5 Cards: The Replacement for Bootstrap 3 Panels

November 25, 2026August 22, 2014 by turgay

Bootstrap 3 panels became cards in Bootstrap 4 and 5. Here is the Bootstrap 5.3 markup for plain, headed and colored cards, plus footers and card grids.

Categories Bootstrap Tags bootstrap, bootstrap panels, twitter bootstrap Leave a comment

Bootstrap 5 Pagination: Markup, States and a Razor Example

November 25, 2026August 22, 2014 by turgay

Bootstrap 5.3 pagination with active and disabled pages, sizes and alignment, a replacement for the removed pager, and a Razor loop that renders page links.

Categories Bootstrap Tags bootstrap, bootstrap pagination, twitter bootstrap Leave a comment

Try, Catch and Finally in C#: Exception Handling Done Right

November 25, 2026August 22, 2014 by turgay

How try, catch and finally work in C#, with catch order, exception filters, rethrowing without losing the stack trace, and when finally does not run.

Categories C# .NET Tags C#, exception handling Leave a comment
Older posts
Newer posts
← Previous Page1 … Page4 Page5 Page6 … Page22 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