10575 2
How to convert a positive number to negative number and negative to positive in C#?

Hello, I would like to know, How can I convert a positive number ( int type) to a negative number in C# and vice-versa ( negative to positive number using C#)?

 

 

...
Type
Question
10502 3
Useful Visual Studio Shortcuts (comment, remove comment, Collapse code etc )
In this article, I have provided many useful shortcut keyboard keys to use while coding in Visual Studio, for example shortcut to comment a code, collapse a code region, edit multiple lines etc
Type
Article
10459 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
10456 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
10334 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


10166 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
10016 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
9842 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
9842 3
How to create Excel file using C# without Microsoft office & interop?

Hello, I would like to know how can I generate excel file in my C# project without installing Microsoft Excel/office or interop on server?Can you please provide me step by step guide or easy tutorial links, anything will work, thanks.

...
Type
Question
9708 2
How to encrypt and decrypt a string in C#? Need easy method with example

How to encrypt and decrypt a string in C#? I would like to know simplest and efficient way for this using some example if possible, thanks

...
Type
Question

Page 5 of 23