Top ".net" questions

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

Multiple file-extensions searchPattern for System.IO.Directory.GetFiles

What is the syntax for setting multiple file-extensions as searchPattern on Directory.GetFiles()? For example filtering out files with .aspx …

c# .net system.io.directory
Calling a function from a string in C#

I know in php you are able to make a call like: $function_name = 'hello'; $function_name(); function hello() { echo …

c# .net php string function-calls
Creating a DateTime in a specific Time Zone in c#

I'm trying to create a unit test to test the case for when the timezone changes on a machine because …

c# .net datetime timezone .net-3.5
Set System.Drawing.Color values

Hi how to set R G B values in System.Drawing.Color.G ? which is like System.Drawing.Color.G=255; …

c# .net colors immutability system.drawing.color
HTTP POST Returns Error: 417 "Expectation Failed."

When I try to POST to a URL it results in the following exception: The remote server returned an error: (417) …

c# .net http http-post webclient
How to check for file lock?

Is there any way to check whether a file is locked without using a try/catch block? Right now, the …

c# .net io filelock
Multiple actions were found that match the request in Web Api

I keep getting this error when I try to have 2 "Get" methods Multiple actions were found that match the request: …

c# .net asp.net-web-api asp.net-web-api-routing
Generic List - moving an item within the list

So I have a generic list, and an oldIndex and a newIndex value. I want to move the item at …

c# .net generics list
Convert string to hex-string in C#

I have a string like "sample". I want to get a string of it in hex format; like this: "796173767265" Please …

c# .net string hex