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#

Find Hidden Files in a Directory in C#

November 25, 2026June 15, 2014 by turgay

List hidden files in a folder in C# with DirectoryInfo and FileAttributes, and avoid the EnumerationOptions default that skips them.

Categories C# .NET Tags C#, directory, enumerate files, hidden files, list files 2 Comments

Select XML Nodes with XPath in C#: Filters, Functions, Namespaces

November 25, 2026June 15, 2014 by turgay

XPath queries in C# with XmlDocument and XDocument: filter by position or value, use count() and sum(), and handle XML namespaces correctly.

Categories C# .NET, XML Tags C#, find in xml, select nodes, xpath Leave a comment

Commonly Used Attributes in C# and What They Do

November 25, 2026June 14, 2014 by turgay

The C# attributes you will meet most often, grouped by job: compiler hints, caller info, serialization, validation and designer metadata, with examples.

Categories C# .NET Tags attribute, C#, most useful Leave a comment

C# Delegates and Events Explained with a Simple Example

November 25, 2026June 14, 2014 by turgay

What delegates and events are in C#, how to declare and raise an event with EventHandler, and the traps around unsubscribing and exceptions.

Categories C# .NET Tags C#, delegate, event Leave a comment

Thread-Safe Singleton Pattern in C# Using Lazy

November 25, 2026June 14, 2014 by turgay

Implement a thread-safe, lazily created singleton in C# with Lazy, compare it with double-checked locking, and know when dependency injection is the better choice.

Categories C# .NET Tags C#, pattern, singleton pattern 1 Comment
Older posts
Newer posts
← Previous Page1 … Page12 Page13 Page14 … Page16 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