Click here to Skip to main content
15,885,309 members
Everything / Programming Languages / C#

C#

C#

Great Reads

by Wonde Tadesse
The other option will be to use Update Panel ASP.NET control as much as possible. It helps to retain the current position on the page whenever a postback happens to the page.
by Alex Pumpet
A simple program for comparing table data from two sources - SQL databases, Excel, CSV or XML-files
by Dr. WPF
.NET 3.5 SP1 is here! It's time to break out your DirectX skills. This article provides the information necessary to get started using a new DirectX interop feature in WPF called D3DImage.
by John Atten
OWIN, Katana and Middleware Pipeline in ASP.NET

Latest Articles

by honey the codewitch
How to validate fields for things like data entry applications.
by Yevgeniy Shunevych
An introduction to Atata C#/.NET web UI test automation full-featured framework based on Selenium WebDriver
by honey the codewitch
Scraping the web is easy with Visual FA. Here's an example of how.
by Zijian
Reusable codes for JWT security in business applications

All Articles

Sort by Title

C# 

18 May 2012 by deeptibansal
Adding event to Microsoft Outlook through Web Application
27 Mar 2015 by Joe Programmer 1
Maximizing XOR challenge sample
16 Aug 2022 by Bohdan Stupak
"Method can be static" Microsoft Code Analysis warning may hide a violation of object-oriented design
24 Jan 2016 by Daniel Brousser
Custom TextBox control for UI input validation
7 Jan 2011 by Anupama Roy
How to delete a folder created via code programmatically
4 Feb 2012 by SoftwareMonkeys
Sometimes, it's useful to know whether you're running in debug or release mode so you can do extra work during debugging and skip it during release. This class makes that as simple as possible.
29 Jan 2012 by Pablo Aliskevicius
You can make it a bit shorter: public virtual bool IsDebug { get { #if (DEBUG) return true; #else return false; #endif } }Thanks for sharing,
1 Feb 2012 by Huisheng Chen
Have a look this one, I just wrote: Accurate way to tell if an assembly is compiled in debug or release mode in c#[^] public static bool IsInDebugMode(string FileName) { var assembly = System.Reflection.Assembly.LoadFile(FileName); var attributes =...
3 Feb 2012 by SoftwareMonkeys
While I think alternative 3 could be quite useful I often have access to the assembly name and not the actual file name.For example the assembly name might be:Company.ProductWhereas the file name might be:Company.Product.dllThere are times when I'll fully qualify a class such...
24 Feb 2012 by Andreas Gieriet
I prefer the [Conditional("DEBUG")] attribute over #if DEBUG.This is especially advised for your logging example.E.g.[System.Diagnostics.Conditional("DEBUG")]private void Validate() { /* check instance integrity */ }or[System.Diagnostics.Conditional("DEBUG")]public static...
16 Jun 2016 by Tomaž Štih
How to (dynamically) implement ToString() as a Lambda function
4 Jan 2011 by Pranay Rana
(Linq and Nullable Values) OR (SQL ISNULL with LINQ)
27 Jun 2015 by Pedram_Niloufari
C# .Gif viewer / Snipper control
23 Sep 2013 by sumit_kapadia
Simple and free approach to manage your code on cloud with git-SCN and dropbox
22 May 2010 by #realJSOP
Don't reinvent the wheel - use the one that's already on the cart.
6 Apr 2010 by TheGreatAndPowerfulOz
The following is far easier to understand and use than the Outlaw's tip (IMHO).text = Regex.Replace(text, "screen_fadetimeout=\"[^\"\']+\"", "screen_fatetimeout="99");It has the following advantages:1. It is one line of code2. It is easier to read3. It is faster (note: XmlElement...
17 May 2010 by Sarang Date
Any string input can have these many possible states1) String is null2) String is empty3) String contains nothing but white space4) String has some contentTill now, .NET had static method for stringbool string.IsNullOrEmpty()which handled first two conditions for...
12 Aug 2010 by jfriedman
public static class StringExtensions { public static bool IsNullOrWhitespace(this string s) { if (null == s) return true; return string.IsNullOrEmpty(s.Trim()); } }
18 Mar 2014 by Johannes Bildstein
Reading and writing Bitmaps with full 16bit per channel (and possibly more)
19 Mar 2015 by Peter T. Ringering
A program that makes editing code comments and XML comments easier.
20 Jan 2010 by Vinayaka Krishna Shenoy
.NET Coding Best Practices - Vinayak's thumb rulesDo not hard code strings/ numerics. Instead of that use constants as shown below.Bad practice int Count; Count = 100; if( Count == 0 ) { // DO something… }Good practice int Count; Count = 100; private...
9 Nov 2021 by Member 12660776
Programmatically Adding New ConfigurationSectionGroup Corrupts Declaration Section With Multiple Group Declarations.
27 Sep 2023 by Victor Sirghii
On the parent razor page, we add Partial View which will serve as the updatable container. On Ajax calls from the parent page, we update only Partial view content, not the whole page, thus creating a smooth user interaction experience.
13 Jan 2020 by M.M.Mohseni
In this article, we'll explain how to register (Add) all specific interface assignable types in an assembly and will use them in a class.
19 Mar 2020 by RickZeeland
Version all your .NET Core projects in one swoop fell!
6 May 2015 by Etienne Louise (974)
In this article I'll show how to create custom culture and then show an exemple of how to use it in an ASP.Net MVC application.
4 Nov 2013 by SimbarasheM
A .NET v4 Library for converting DataTable row(s) to JSON String for WCFServices
7 Jul 2015 by Pavel Durov
Tip about converting .NET DateTime to Unix double timestamp and vise versa - on .NET
31 Mar 2011 by Jon_Slaughter
Simple class to encapsulate a double reference
8 Jul 2014 by B.O.B.
How to get correct caret position from Textbox control
31 May 2016 by Yaseer Mumtaz
.NET interview questions and answers with real world examples and code snippets
11 Dec 2014 by Zzzzzoltan
A novel solution to the 32 vs 64-bit DLL interop problem
25 Dec 2014 by Amir Hamza Md. Kayes
.NET interprocess communication using named pipe
30 Jan 2014 by rmostafa
Simple Google Analytics Access, with Service Account Credential OAuth2
24 Jan 2016 by Dmitry Orzhevsky
This article dives into .NET method inlining topic and shed some light on one particular case when CLR is more likely to inline method - looping.
22 May 2010 by Vinayaka Krishna Shenoy
.Net Performance tip - 2
22 May 2010 by DaveAuld
Here is a better evaluation of performance in .Net of the If / Switch operations;http://www.blackwasp.co.uk/SpeedTestIfElseSwitch.aspx[^]
22 May 2010 by Vinayaka Krishna Shenoy
.Net Performance tip - 3
21 Jul 2018 by Ben Hall (failingfast.io)
Micro-Benchmarking Your C# - Pitfalls and A Tool To Help You Mitigate Them
21 Apr 2013 by emadns
Second tutorial for loading data through code - Sqlite
11 Oct 2015 by Bismark Appah
3 Jan 2015 by Peter Piotti
A clean, simple alternative to using the Entity Framework for stored procedures data access in a .NET/SQL Server environment
19 May 2020 by Daan Acohen
An explanation of how to support multiple platforms in .NET development
1 Feb 2013 by S. M. Ahasan Habib
.NET TransactionScope and its default Transaction Isolation level issue.
14 Mar 2014 by Nikita D. Sinelnikov
HowTo: make the report background (elements) of Microsoft .NET Report (.rdlc) non-printable
23 Oct 2014 by BrokenEvent
.NET WinForms Tray icon implemenation with Win7 and Vista features: GUID identification, large custom icons, custom UI instead of the hint, etc.
23 Oct 2015 by Yaseer Mumtaz
XML input parameter to RESTful API using HttpClient and bypassing the SSL certificate
16 Feb 2018 by Alberto M.
Zlib compress / decompress implementation using .NET 4.5.1, with no external DLLs
15 Nov 2010 by qlipoth
All too often, I have to match disparate objects 1 to 1
5 Jun 2011 by thatraja
Display Date Time in 12/24 hour time format in C#/VB.NET
29 Nov 2015 by Michael Bogaerts
What brings the 15.2 release for XAF (win) developers
24 Aug 2018 by simonp_ca
How to remove Windows service from Service List (not just stop/disable it, but to delete it from the list totally)
5 Jul 2012 by Sumit Chawla
2-Legged OAuth Authentication in .NET (C#)
19 Jan 2015 by JatinKhimani
Develop a web application in 3 layer architecture code style
11 Mar 2014 by Prasanna Venkatesh . K
Writing a Windows store background app from the scratch
21 Sep 2010 by GPUToaster™
A simple way to detect bitness of an OS Programatically. (C# and C++ examples given)
13 Oct 2010 by Reinhard Ostermeier
In .NET 4.0, you can also use the new System.Environment.Is64BitOperatingSystem and System.Environment.Is64BitProcess
19 Sep 2010 by Aescleal
In C++ you can use the size of a pointer to work out what sort of process you're running in:bool is_64_bit(){ return sizeof(void *) == 8;}This has got the advantage of being portable and you don't have to call any OS functions.You can do something similar in C - just return...
20 Sep 2010 by a_pess
To check 64Bit Operating system in VB.NET,Public Shared Function is64BitOPeratinSystem() As Boolean Return (Marshal.SizeOf(IntPtr.Zero) = 8)End Function
5 Aug 2011 by The_Mega_ZZTer
Version check is wrong. It happens to work correctly only because no minor versions of Windows 5 were released after 5.1 (AFAIK... are Windows Server 2003 and Embedded XP and Media Center XP still 5.1?). A theoretical version 5.2 would fail the check. I submit the following...
2 Feb 2014 by AnobikDey
A description of how images and other controls can be rotated and used to give 3d Effect in Windows Store Apps
20 Jan 2015 by charles922
3D programming with OpenGl and C# to create an interactive puzzle
25 Jan 2014 by Calabash Sisters
This article aims at talking about some useful solutions for you to merge to multiple excel worksheets into one.
7 Feb 2014 by comiscience
4 ways to do Object copy
19 Jul 2015 by Revanth Ramesh
Futuristic Talking 7-Segment Time Display Widget in WPF
12 Mar 2012 by Muthu Nadar
This article will explain about null coalescing operator along with its advantage and disadvantage.
16 Jun 2012 by Nadege Rouelle
How to add initialization data when configuring Entity Framework Code First.
12 Apr 2017 by Dave “DWC” Curry
How to wire up drag+drop events through multiple objects.
24 Aug 2012 by Savalia Manoj M
How to create custom Datapager Usercontrol in Silverlight?
7 Apr 2016 by The Zakies
Part 3 of a tutorial to show a graphics program using C# using GDI and SVG drag and drop and delete objects
20 Jun 2016 by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
24 Jun 2016 by The Zakies
in this tut we will create a technique to enable the user to control points within a drawn line, by drawing circles around points of the line , when the user clicks a circle he would control the corresponding point.
29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
13 Mar 2016 by The Zakies
Tutorial 1 (how to create a vector graphics program)
7 Jun 2016 by The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
20 Jun 2016 by The Zakies
Learn how to implement a tecnique of a parent form that createes and controls other forms , through the tecnique of using the tab control, also learn how to implement a menu for the tools, and how to add cutom cursor for each tool
27 Sep 2018 by Georgeutc
A very simple Resizable SplitView
16 Apr 2013 by Louis_Liu
WPF application to capture screen.
25 Feb 2015 by saad_lah
Complete guide for beginner to setup EmguCV project and run first program in Visual Studio
20 Feb 2014 by toneware
A utility that monitors a selected directory for changes
19 Sep 2012 by Jens Theisen
A grid splitter separating four quadrants
5 Nov 2014 by Jeong, WonYoung(Brad)
Making BitField with C# alternative to BitField made with union and struct of C++
16 Feb 2022 by charles henington
Simple user defined Cipher Transform that I got the idea from https://www.codeproject.com/Articles/5319044/ARC4-Encryption-Library
30 Nov 2014 by SrikantSahu
This is a simple application developed using C# MVC and jquery for basic CRUD operations. The application can be unit tested using selenium web drivers.
22 Dec 2015 by MarcusCole6833
A basic tutorial on how to Use WCF service with the Entity Framework
16 Jul 2015 by Math08avan
A simple example for CRUD actions using WCF service in ASP.NET
22 Apr 2016 by Darryl Bryk
C# code for a low-pass Butterworth filter is presented
9 Mar 2017 by TheGreatAndPowerfulOz
How to recursively select all descendants using an extension method
12 Apr 2012 by OriginalGriff
If you haven't heard of AI Memo 239, then you need to have a look at it. It is an MIT memo from 1972 containing "clever code" and such like. Some of it is absolutely beautiful!
19 Dec 2010 by Ian Shlasko
Unless I'm misreading your code on CodePlex, it looks like your utility loads in the entire file every time it changes. That might be fine for tiny files, but it would be a huge performance hit for larger ones (a few megs, for example).Why not do it a bit more simply?using (FileStream str...
18 Jun 2013 by Michiel du Toit
Code for a C# string.Like extension method.
15 Apr 2015 by sx2008
An easy-to-use class to prevent multiple instances of your application from opening and focusing/activating the first instance window.
30 Dec 2022 by Graham Wilson
A collection of simple .NET Framework/.NET WinForm controls and utilities.
19 Nov 2013 by YOSSI ROZENBERG
A computational statistics class in C#
6 Jan 2020 by honey the codewitch
Easily add progress reporting to your console apps