current location:Home > Technical Articles > Backend Development > C#.Net Tutorial

  • StringWriter vs. StringReader in C#?
    StringWriter vs. StringReader in C#?
    StringReader and StringWriter are derived from TextReader and TextWriter. StringWriter is used for writing to string buffers. It implements a TextWriter for writing information to a string. For StringWriter - example StringWritersWriter=newStringWriter();while(true){ myChar=strReader.Read(); if(myChar==-1)break
    C#.Net Tutorial 912 2023-09-15 16:17:02
  • Why do indexes in C# arrays start from zero?
    Why do indexes in C# arrays start from zero?
    An array is a pointer to an address in index memory. The index is the first element of the array. Here, the index is like an offset, a concept that even predates the origin of the C language. Suppose your array elements start from 0Xff000 and have 5 elements, such as {35,23,67,88,90}. So the array in memory will look like below since int is stored using 4 bytes. 0Xff000has350Xff004has230Xff008has670Xff012has880Xff016has90 This means when accessing the array, zero offset will be index 0. Let us further understand the concept of zero indexing in C# - if an array is empty, it has 0 elements and has a length of 0.
    C#.Net Tutorial 1589 2023-09-15 14:57:03
  • What are the important namespaces in C#? Provide a brief description of each
    What are the important namespaces in C#? Provide a brief description of each
    .NET contains a large number of namespaces, and even more if you include third-party libraries. However, there are some that you will use again and again. Here are 20 that can help you solve 80% of common, recurring programming problems. The system contains the most basic types. These include commonly used classes, structures, enumerations, events, interfaces, etc. System.Text contains classes representing ASCII and Unicode character encodings. Class for converting between blocks of characters and blocks of bytes. System.Text.RegularExpressions provides regular expression functionality. System.Linq provides classes and interfaces that support queries using Language Integrated Query (LINQ). System.XM
    C#.Net Tutorial 709 2023-09-15 13:53:21
  • Print using your own fonts using C#
    Print using your own fonts using C#
    To print your own font in C#, first construct a -FontFamily object. Font object. The FontFamily object sets fonts such as Arial, TimesNewRoman, etc., and the Font object sets the size and style of the font. Let's create an Arial font style. FontFamilymyFontFamily=newFontFamily("Arial");FontmyFont=newFont(myFontFamily,20,FontStyle.Bold,GraphicsUnit.Pixel); Above, we set FontFamily
    C#.Net Tutorial 1053 2023-09-15 12:29:09
  • What are the various JSON files available in C# ASP.NET Core?
    What are the various JSON files available in C# ASP.NET Core?
    ASP.netCore is re-architected from previous ASP.net versions, including configuration dependencies on System.Configuration and xml configuration in the web.config file. In ASP.netCore, a new easy way solution to declare and access global settings, project specific settings, client specific settings and more. New configuration model for XML, INI and JSON files. Different configuration JSON files in ASP.netCore There are mainly 6 configuration JSON files in ASP.netCore. global.jsonlaunchsettings.jsonappsettings.j
    C#.Net Tutorial 891 2023-09-15 12:29:05
  • C# program to convert Fahrenheit to Celsius
    C# program to convert Fahrenheit to Celsius
    First, set the temperature in Fahrenheit - doublefahrenheit=97; Console.WriteLine("Fahrenheit:"+fahrenheit); Now convert it to Celsius - celsius=(fahrenheit-32)*5/9; Example You can try running the following code to convert Fahrenheit to Fahrenheit Convert temperature to degrees Celsius. Live demonstration usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceDemo{&n
    C#.Net Tutorial 1220 2023-09-15 11:53:09
  • Thread pool in C#
    Thread pool in C#
    A thread pool in C# is a collection of threads. It is used to perform tasks in the background. When a thread completes its task, it is sent to the queue where all waiting threads exist. This is done so that it can be reused. Let's see how to create a thread pool. First, use the following namespace - usingSystem.Threading; now, call the thread pool class using the thread pool object. Call the QueueUserWorkItem method - ThreadPool.QueueUserWorkItem(newWaitCallback(Run)); iterate over it in a loop and compare it with a normal Thread object.
    C#.Net Tutorial 1198 2023-09-15 11:37:02
  • Join, Sleep and Abort methods in C# threads
    Join, Sleep and Abort methods in C# threads
    Join blocks the calling thread until the thread terminates, while continuing to perform standard COM and SendMessage pumping. This method has different overloaded forms. Sleep causes the thread to pause for a period of time. AbortAbort method is used to destroy threads. Let's look at an example of Join() in a thread - example usingSystem;usingSystem.Diagnostics;usingSystem.Threading;namespaceSample{ classDemo{ static
    C#.Net Tutorial 1609 2023-09-15 11:01:09
  • What is the C# equivalent of the friend keyword in C++?
    What is the C# equivalent of the friend keyword in C++?
    The friend function of a friend class in C# is defined outside the scope of the class, but it has access to all private and protected members of the class. Although the prototype of a friend function appears in the class definition, a friend is not a member function. A friend can be a function, function template, or member function, or it can be a class or class template, in which case the entire class and all its members are friends. The closest equivalent in C++ to a friend in C# is to create a nested class that will access the private members of the outer class. Here, the inner class can access the private members of the outer class - classOuter{ classInner{ }}
    C#.Net Tutorial 739 2023-09-15 10:53:02
  • Access modifiers in C#
    Access modifiers in C#
    Access modifiers specify the scope of variables and functions in C#. The following are the access modifiers provided by C#: The Public modifier places no restrictions on member access. Protected access is limited to derived classes or class definitions. Its declaration is accessed by internal access modifiers within a program with the following permissions. protected internal It has access specifiers provided by both protected and internal access modifiers. Private only within the class in which it is declared. Members designated as private cannot be accessed outside the class. Example Let's look at an example of protected access modifier, accessing protected members - live demonstration usingSystem;namespaceMySpecifiers{&nbs
    C#.Net Tutorial 940 2023-09-15 08:37:02
  • What is the overloading capability of operators in C#
    What is the overloading capability of operators in C#
    The following is a list of operators that can be overloaded in C#, and the operators that cannot be overloaded. Ordinal operators and descriptions 1+,-,!,~,++,--These unary operators accept one operand and can be overloaded. 2+,-,*,/,% These binary operators accept two operands and can be overloaded. 3==,!=,,= comparison operators can be overloaded. 4&&, || conditional logical operators cannot be directly overloaded. 5+=,-=,*=,/=,%= assignment operators cannot be overloaded. 6=,.,?:,-
    C#.Net Tutorial 1264 2023-09-15 08:13:08
  • What are the if/then directives in C# for debugging and publishing?
    What are the if/then directives in C# for debugging and publishing?
    There are different configurations for building your .Net project in Visual Studio debug mode and release mode. Select Debug mode to step through your .Net project, then select Release mode where the assembly file (.dll or .exe) is finally built. To change the build configuration - From the Build menu, select Configuration Manager, then Debug or Release. Or on the toolbar, select Debug or Release from the solution configuration. Code written in #ifdebug will only be executed if run in debug mode. If the code is running in release mode, #ifDebug will be false and the code present within it will not be executed. Example classProgram{
    C#.Net Tutorial 1236 2023-09-14 22:29:08
  • Abstract classes, sealed classes and class members in C#
    Abstract classes, sealed classes and class members in C#
    Abstract classes include abstract methods and non-abstract methods. Abstract classes cannot be instantiated. A sealed class prevents inheritance and cannot be used as a base class. Abstract Class To declare an abstract class, you need to put the keyword abstract before the class definition. An example of a class member in an abstract class is as follows, an abstract method is defined - publicabstractclassVehicle{ publicabstractvoiddisplay();} The abstract method definition is followed by a semicolon because it is not implemented. Sealed class To declare a sealed class, you need to place the keyword seal class definition in front. A sealed class prevents inheritance, and you cannot use it as a base class. publicse
    C#.Net Tutorial 845 2023-09-14 22:21:06
  • How to find the number of CPU cores in C#?
    How to find the number of CPU cores in C#?
    We can get a variety of different information related to the processor. The number of physical processors, the number of cores, and the number of logical processors. These can all be different; taking a machine with 2 dual-core hyperthreading enabled as an example of a processor, there are 2 physical processors, 4 cores and 8 logical processors. The number of logical processors is available through the Environment class, but other information is only available through WMI (and you may need to install some hotfixes or service packs on some systems for this to work) − Add the following to your project Reference to System.Management.dll. In .NET Core, this is provided as a NuGet package (Windows only). thing
    C#.Net Tutorial 1281 2023-09-14 22:21:02
  • What are destructors in C# 7.0?
    What are destructors in C# 7.0?
    C# allows multiple destructor methods to be used in the same program with the same number of output parameters or the same number and type of output parameters in a different order. It's part of the new tuple syntax - not related to the Tuple class, but taken from functional programming. Deconstruct keyword is used for destructuring function example publicclassEmployee{ publicEmployee(stringemployeename,stringfirstName,stringlastName){ Employeename
    C#.Net Tutorial 1154 2023-09-14 22:05:03

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28