Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

How do I convert struct System.Byte byte[] to a System.IO.Stream object in C#?

How do I convert struct System.Byte byte[] to a System.IO.Stream object in C#?

c# .net arrays stream
When to use .First and when to use .FirstOrDefault with LINQ?

I've searched around and haven't really found a clear answer as to when you'd want to use .First and when …

c# .net linq
Easiest way to read from and write to files

There are a lot of different ways to read and write files (text files, not binary) in C#. I just …

c# .net string file file-io
Sending email in .NET through Gmail

Instead of relying on my host to send an email, I was thinking of sending the email messages using my …

c# .net email smtp gmail
Find and extract a number from a string

I have a requirement to find and extract a number contained within a string. For example, from these strings: string …

c# .net regex string
Check if list contains element that contains a string and get that element

While searching for an answer to this question, I've run into similar ones utilizing LINQ but I haven't been able …

c# .net linq list contains
Easiest way to split a string on newlines in .NET?

I need to split a string into newlines in .NET and the only way I know of to split strings …

c# .net string split
How to use OpenFileDialog to select a folder?

How to use OpenFileDialog to select folders? I was going to use the following project: https://github.com/scottwis/OpenFileOrFolderDialog …

c# .net dialog openfiledialog
Is there a way to check if a file is in use?

I'm writing a program in C# that needs to repeatedly access 1 image file. Most of the time it works, but …

c# .net file file-io file-locking
How do I get the directory from a file's full path?

What is the simplest way to get the directory that a file is in? I'm using this to set a …

c# .net file file-io directory