Blog

Page 745 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Reading settings from app.config or web.config in .NET
c#.net

Reading settings from app.config or web.config in .NET

Published on September 2, 2023

# Reading settings from app.config or web.config in .NET: A Complete Guide šŸ“œ Welcome to our tech blog! Today we are going to tackle a common issue in .NET development: reading settings from the `app.config` or `web.config` files. šŸŽÆ Whether you're workin

Cover Image for String representation of an Enum
c#enums

String representation of an Enum

Published on September 2, 2023

# String Representation of an Enum: Simplifying Enum Values šŸ” šŸ’”šŸ“Š Have you ever encountered the problem of needing the actual word representation of an enum value instead of its underlying ID? If so, you're not alone! The good news is that there is a sol

Cover Image for How do I use Assert to verify that an exception has been thrown with MSTest?
assertc#unit-testing

How do I use Assert to verify that an exception has been thrown with MSTest?

Published on September 2, 2023

# šŸŽÆ How to Use Assert to Verify That an Exception Has Been Thrown with MSTest If you're using MSTest (Microsoft.VisualStudio.TestTools.UnitTesting) for your unit tests, you might have come across the need to verify that an exception is thrown in your cod

Cover Image for split a string on newlines in .NET
c#.netsplitstring

split a string on newlines in .NET

Published on September 2, 2023

# Splitting a String on Newlines in .NET: The Ultimate Guide! šŸš€ Are you struggling to split a string on newlines in .NET? Don't worry, you're not alone! Many developers face this common issue when working with text data. But fear not, because in this art

Cover Image for How can I convert a Unix timestamp to DateTime and vice versa?
c#data-conversiondatetime

How can I convert a Unix timestamp to DateTime and vice versa?

Published on September 2, 2023

šŸ“ **Converting Unix Timestamp to DateTime and Vice Versa: A Simple Guide** šŸ•’ Are you struggling with converting Unix timestamps to DateTime and vice versa? Don't worry, we've got you covered! In this blog post, we'll address common issues, provide easy

Cover Image for Is there a way to check if a file is in use?
c#filefile-io.net

Is there a way to check if a file is in use?

Published on September 2, 2023

šŸ“ **Blog Post: Is There a Way to Check if a File is in Use?** Hey tech enthusiasts! šŸ‘‹ Are you working on a program that needs to access a specific file repeatedly, but constantly encountering the dreaded "File in use by another process" error? šŸ¤” Don't

Cover Image for Proper use of "yield return"
c#

Proper use of "yield return"

Published on September 2, 2023

# Proper Use of `yield return` in C# Do you ever feel like you're in a mysterious maze when it comes to understanding the 'yield' keyword in C#? Well, friend, you're not alone! Many developers struggle with it and are unsure if they're using it correctly.

Cover Image for How do I generate a stream from a string?
c#streamstringunit-testing

How do I generate a stream from a string?

Published on September 2, 2023

šŸ“šŸ”„šŸŽ‰ Blog Post: How to Generate a Stream from a String: A Complete Guide šŸŽ‰šŸ”„ Are you struggling with generating a stream from a string? Look no further! In this blog post, we'll explore common issues and provide easy solutions, so you can generate a st

Cover Image for decimal vs double! - Which one should I use and when?
c#currencydecimalprecision

decimal vs double! - Which one should I use and when?

Published on September 2, 2023

# Decimal vs Double: Choose Wisely for Precise Calculations! šŸ’ø As a programmer, you want your calculations to be accurate, especially when dealing with money. But when it comes to choosing between `decimal` and `double` in C#, things can get a bit confus

Cover Image for What"s the difference between the "ref" and "out" keywords?
c#keywordreference

What"s the difference between the "ref" and "out" keywords?

Published on September 2, 2023

šŸ”Œ Understanding the 'ref' and 'out' Keywords in C# So, you're delving into the world of C# programming and stumbled upon the 'ref' and 'out' keywords. šŸ¤” Don't sweat it! In this beginner-friendly guide, I'll explain the key differences between these two