11955 2
How can I get application root folder location in C# Console application?

I am creating a C# console application for some test project, in which I need to get Root folder location (application path) of project, for example, if my project is in "C:\Project\Program.cs", so i should get "C:\Project\" drive as root location. 

How can I get it using C# console application, in web-application we get it using Server.MapPath("~/") but I am not sure about console application.

...
Type
Question
11951 3
Convert string of "dd/MM/yyyy" format into Datetime using C#?

I am using the code below to convert my string which is in the format "dd/MM/yyyy" into datetime

...
Type
Question
11951 2
how to implement switch case in Razor (.cshtml)?

I need to implement switch case in Razor C# page as if-else would not be a good idea, because it will create too many conditions, so i thought to create Switch case instead, here is my current code, but it throwing syntax error

...
Type
Question
11897 3
How to convert byte[] array to string and Vice versa in C#?

Hello, I would like to know how to convert byte[] array to string and string to byte[] array in C#, using the best possible method, I know there are several links and methods available on the internet but I would like to know best and easy method for this, thanks.

...
Type
Question
11836 0
Open and Read XML in C# (Examples using Linq, XMLReader, XMLDocument)
In this article, I have provided C# code to open and read XML file node using XMLReader or using Linq in Console application, with example of which one is fastest.
Type
Article


11655 2
How to find and extract only number from string in C#?

I have a string with numbers in it, for example here is the string "121 testing your City", now, I would like to extract only "121" from the string, how can I do that using C#?

...
Type
Question
11621 0
How to convert string to int in C#?
In this article, I will provide you quick and easy ways to convert string to int using int.parse and int.tryparse with explaining the difference between these two.
Type
Article
11568 2
C# error "Type 'string' does not contain a definition for 'equals' and no extension method 'equals' of type 'string' could be found."

Hi please I'm converting 12-hour AM/PM format, to military 24-hour time format using C# Console app.

Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a 24-hour clock.

My code is that :

...
Type
Question
11304 0
Hello World Visual Studio Code C# Example
In this article, I have provided step by step procedure to create hello world program in C# using Visual Studio Code and how to create new console project in it.
Type
Article
11221 0
Converting String to Enum OR Enum to String in C#
In this article, I have explained with a console application example, how you can convert string to enum in C# OR Enum to string
Type
Article

Page 5 of 24