Click here to Skip to main content
15,886,422 members
Everything / Programming Languages / C# 3.0

C# 3.0

C#3.0

Great Reads

by Jeffrey Walton
Import and export Cryptographic Keys in PKCS#8 and X.509 formats, using Crypto++, C#, and Java.
by Daniel Vaughan
Calcium provides much of what one needs to rapidly build a multifaceted and sophisticated modular application. Includes a host of modules and services, and an infrastructure that is ready to use in your next application.
by Dark Daskin
Article describes how to build an assembly that exposes functions to unmanaged code without C++/CLI
by Sacha Barber
It would probably be like Cinch, an MVVM framework for WPF.

Latest Articles

by Shivprasad koirala
Design Pattern FAQ - Interview Questions (Quick Reference)
by Harsha T, Amarnath S, S Mahesh Reddy
A simple viewer of images stored in the DICOM 3.0 File Format (C#). The file should have raw pixel data, uncompressed. Window Level functionality is also provided.
by AlexeyYakovlev
This paper demonstrates a technique of building Sprache parsers using grammar inheritance.
by Randy Kroeger
This article provides an example on how you can change application configuration settings within an existing ClickOnce publish, update the manifest files, followed by using the Mage utility for updating the manifest using the existing cert file.

All Articles

Sort by Score

C# 3.0 

23 Mar 2010 by AspDotNetDev
This version works regardless of parameters:public void AnyMethod(int parameter){ MethodInvoker wrapper = new MethodInvoker(delegate() { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}Note also...
24 Jan 2015 by shijo joseph
A file backup manager with simple user interface and all the essential functionalities.
16 Feb 2010 by Pranay Rana
Following is code by which you get time in (HH:SS:MM) formate by passing second as argument public string getFormattedTimeFromSecond(double second) { TimeSpan t = TimeSpan.FromSeconds(second); string formatedTime = string.Format("{0:D2}H:{1:D2}M:{2:D2}S", ...
19 Oct 2010 by Ziv Nitzan
There is also a Visual Studio extention called CodeMaid that has a lot of cleaning options http://bit.ly/diMTaR
12 Apr 2011 by Kamran Behzad
You inspired me to contribute the DateTime extensions methods that I use in my programs. (But use at your own risk!). Thank you./// /// Date and Time Manager class./// public static class DateMan{ /// /// Returns the age in years for the given DOB...
28 Apr 2015 by Hassan Alrehamy
JSON Deserialization in depth concept and Dictionary mapping. Special Thanks to Dr. Coral Walker
23 Jul 2010 by Pandey Vinay
This is a direction to use Google Maps API Rest Services instead of using it from JavaScript.
6 Sep 2010 by DaveyM69
How to convert a generic List of derived types to a generic list of base types.
26 Dec 2010 by #realJSOP
Can't you just call Enum.GetNames(), and then bind to the collection returned by that method?
19 Jan 2011 by Pranay Rana
Linq Joins with SelectMany
5 Jun 2011 by JV9999
Not really, because what if your finally block would contain more lines of code than the single line you have in your example? That would make it already much harder to read.Secondly, you are misusing the Dispose method. You shouldn't invoke anything in it, especially not the Action, you...
20 Nov 2011 by Bernhard Hiller
That's far too obscure.All you need to do is store a reference to the TabPage instance which was removed from the TabPages collection of the TabControl. You may use the form where the TabControl is placed for that purpose.You could also create your own TabControl which has an extra property...
17 May 2010 by Rama Krishna Vavilala
I will just make it a little more compact by omitting the Contains method:public static string GetValue(this XElement root, string name, string defaultValue) { return (string)root.Elements(name).FirstOrDefault() ?? defaultValue; }The explicit operators for XElement...
17 Jun 2011 by VallarasuS
Here is how you can achieve Gradients used in Office 2010 Buttons with a glow at the bottom.
20 Jul 2011 by cmschick
Thanks for sharing. I have a similar utility with additional capabilities that some of you might find useful.using Microsoft.VisualBasic;using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Diagnostics;using...
7 Jun 2012 by AndrewSmith
Creating a custom base job class for quartz scheduler development
14 Feb 2014 by BenScharbach
How-To Convert a String Collection to a Multi-Enum item using TryParse
18 Feb 2015 by Nandakishore G N
Windows Phone 8 chat application using Openfire server
18 Jan 2012 by johannesnestler
Very good tip. I just want to mention an alternative - you can just change your project output type to a console application. (You can undo it later if only needed for debugging). So if you started with a Windows Forms project in Visual Studio: Go to project properties/application/ and in the...
25 May 2012 by Tauseef M
This tool is used for Encryption of Database in SQL Server 2008 Enterprise Edition
2 Aug 2012 by Himanshu Thawait
WCF With No config file needed – all setting in code only, No IIS – Self hosted, consume by channel factory
9 May 2013 by Abhay@Accenture
25 Feb 2015 by Mohsen Heydari
Intercepting WCF and SOAP services for logging SOAP envelope
26 Mar 2016 by Sumit Samediya
Here we will learn how to remove default background color of ListBox item on selection in Windows Universal App
4 Jun 2010 by fjparisIII
Cannot use Storyboard because ScrollView.VerticalOffset property is read-only. Must use old fashioned DispatchTimer.
22 Aug 2010 by Moim Hossain
Doing like following for few years now :public void AnyMethod(int parameter){ var wrapper = new Action(()=> { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}
7 Jan 2011 by Member 3128846
Example to implement remoting concept using SQL Server database
18 Dec 2011 by SwarnenduDas
How to fetch an image document from FileNet for a known Document ID
28 Sep 2011 by Ram Balak Sharma
Useful when calling a C# method from JavaScript by using JSON which returns a DataTable.
27 Feb 2012 by Rishikesh_Singh
Filtering records from List similar to Sql IN Operator using LINQ
5 Jun 2012 by Andreas Gieriet
This is an alternative for "Sorting Strings based on the position of the block letter"
13 Apr 2013 by InbarBarkai
Create and use a multiple value slider
6 Nov 2012 by SoumenBanerjee
Get page HTML using System.Net.WebClient class of .NET as well as striping HTML using Regex and export a list into Excel or XML.
19 May 2013 by Yossi Yaari
A solution for monitoring Events called during test.
19 May 2013 by Yossi Yaari
A basic yet generic state machine implementation
14 May 2014 by atlaste
How to fix hiding controls in the Visual Studio user control designer
31 May 2014 by Evgeny Pereguda
This is simple implementation of fast forward 1D DCT-II on MSIL which is generated at runtime.
3 Jul 2014 by yousafzai amazai
ref and out parameters in C#
4 Nov 2014 by Diwakar M A
WPF based preloader animation sample. Let's make WPF applications more interactive during long process.
19 Jun 2015 by ss9o9o9o
Transferring backup files from a remote SQL Server and Dynamic SQL Connection with Restore utility.
23 Mar 2011 by Narsimlu Keshagouni
Adding fonts to Infragistics WebHtmlEditor
12 May 2011 by DrABELL
Hello Steven,As FYI: recently I have published on CodeProject a short article (tip) on rather efficient implementation of GCD/LCM based on Euclid algorithm. They use iteration instead of recursion, because re-cursive algorithms in general and in this particular case are relatively...
30 Sep 2011 by Mohammad A Rahman
Following might be another way to do the job:public static string ConvertDataTableToString(this DataTable dt){ StringBuilder stringBuilder = new StringBuilder(); dt.Rows.Cast().ToList().ForEach(dataRow => { ...
25 Jan 2012 by fastal
VB version:Friend Declare Function AllocConsole Lib "kernel32.dll" () As BooleanFriend Declare Function FreeConsole Lib "kernel32.dll" () As BooleanSub main() Dim MainForm As New frmMain If Command = "" Then MsgBox1 = AddressOf MyMsgBox1 ' messagebox delegate sub call...
25 Feb 2012 by Andreas Gieriet
To not having spoiled the client code with #if DEBUG, you might use the following:[STAThread]static void Main(){ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Debugging.DebugSetupConsole(); ...
12 Jun 2012 by coolnavjot31
In this Artcile i will show you how can we change the value of one column on change of other column in gridview.
12 Jul 2012 by PIEBALDconsult
This is an alternative for "PrettyXML (.NET Port)"
12 Sep 2012 by Praveen Kumar Chauhan (PRK)
Sending Data Through XML to web Services
3 Apr 2013 by In the Face of God
Generalize to access data in a database via HTTP
19 Apr 2013 by indianDEV
Re-sizing images to equalize the width & height
21 Apr 2014 by munagalasantosh
Access Multiple Resource file and find and replace the textual content in resource file
2 Dec 2014 by charles922
Simple Polynomial Addition and Subtraction using Lambda Expressions for sorting Lists
17 Jan 2015 by LLLLGGGG
A really simple implementation of a C# menu for console applications
2 Mar 2010 by Rudy du Plooy
This code creates a mutex before starting an application and releases the mutex when the application is closed. A user will only be able to start the application once. This can be used for services as well./// /// The main entry point for the application.///...
21 Sep 2010 by anshudutta
30 Dec 2010 by Xmen Real
here is what I do to iterate through enumpublic static ABC(Type enumType){ foreach (Enum e in Enum.GetValues(enumType)) { int tvalue = Convert.ToInt32(e); string tname = e.ToString(); }}
13 Jan 2011 by Steve Maier
To get this to work in .NET 4, you have to change the DLLImport signature.[DllImport("kernel32.dll", SetLastError = true)]private static extern IntPtr CreateFile( string lpFileName, uint dwDesiredAccess, int dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, ...
19 Jan 2011 by Sanjay4India
Append New line in multiline TextBox
7 Feb 2011 by Pavel Yermalovich
An example of Prototype pattern
21 Mar 2011 by Nitin Singh India
People wonder how do delegates work and the threading issues associated with multicast ones.
22 Mar 2011 by supercat9
Another approach is to use a generic delegate-factory class. Essentially, the class has a field of generic type, a delegate field which accepts an argument of that type, an parameterless instance method which accepts an argument of that type and invokes the delegate with it, and a static method...
18 Apr 2011 by Kim Togo
Here is a methods that I use to round DateTime class to the next minute interval./// /// Rounds a date value to a given minute interval/// /// Original time value/// Number of minutes to round up or down...
5 Jun 2011 by supercat9
There are times when "try"-related wrappers can be useful. For example, a Try() wrapper DLL written in a language other than C# could pass an Exception parameter to the Finally clause indicating whether the Try clause succeeded. For example:Try (() => {DoSomething();}, (Exception inner_ex)...
20 Jun 2011 by adolfobarallobre
Here is code for an alternate:public class OfficeButton : Button{ public OfficeButton() : base() { } private Color mGradientGlowColorColor; // the Color field public Color GradientGlowColor // the Color property { get { return...
15 Sep 2011 by lperumb
How to export to Excel from DataGrid using an Microsoft Access database.
2 Oct 2011 by kris444
We can better have an extension like: public static class ControlExtension { public static IList FindControlByName(this Control control) where T : Control { List controlsFound = new List(); controlsFound.AddRange(control.Controls.OfType()); ...
6 Jun 2012 by PIEBALDconsult
This is an alternative for "Sorting Strings based on the position of the block letter"
13 Sep 2012 by azweepay
Create a GridViewColumnCollection with resizable and non-resizable columns
27 Sep 2012 by Morten Skaarup
Using recursive programming to solve the puzzle
2 May 2013 by Redslide
HttpLib makes it easier to asynchronously consume data from web services in C#. The library contains methods to upload to and download from web services.
1 Mar 2013 by dgDavidGreene
How to find and link config and other files from other projects within your solution.
12 Jun 2013 by kabdolla
Create your own keyboards, keypads/ virtual buttons on top of other windows; filter unwanted input.
9 Aug 2013 by Redslide
Modify MVC Routing to allow routes such as /Electronics/Software/Operating-Systems/PC/Windows-8-Installer
14 Jun 2014 by Kaveh Yazdi Nezhad
A simple solution to capture entire HTML code of a web page which is displaying on Internet Explorer
18 Jul 2011 by OriginalGriff
I wrote this because I was interested in a Q&A question which asked for exactly that. Since I quite often use DataTables to transfer data, and to display it for debugging I knocked up an extension method to do it.
4 Dec 2013 by Balachandar Jeganathan
Custom attached property in WPF
10 Dec 2016 by Cory Charlton
A thread-safe implementation of the ObservableCollection class
6 Apr 2013 by Thomas Daniels
A tip about how to set the position of a Windows Forms MessageBox in C#
5 Sep 2012 by Tushar K. Skype(tushar.kshirsagar24)
This is a simple ticket printing system that I have prepared for programmers who want to learn how to do receipt like printing.
24 Feb 2014 by Anupam Singh_
This tip is all about understanding the controller factory and exploring it...
1 Aug 2014 by yosonwan
Sometimes we need to kill a process programly. This article talk about how to get process array to process name and filter it.
22 May 2010 by DaveyM69
Now your application can update it's saved data regrdless of the account it is running under.
13 Oct 2014 by Ed Gadziemski
How to set a null binary value (zero-length binary value) in the registry from your C# program.
25 Feb 2014 by JatinKhimani
Nested GridView With Editing Facility of both gridview.
11 Oct 2012 by Mr. Tapan Kumar
In this article I will describe how to integrate paypal in your asp.net web application
22 Jan 2014 by Sandeep Singh Shekhawat
This tip introduces two extension methods of the HtmlHelper class, one that obtains the Id in a jQuery function and another obtains the Name in a jQuery function.
8 May 2014 by youngseagul
How to run Crystal reports in MVC 4 using PDF.js and PDF viewer
22 May 2012 by Daniel Lo Nigro
Custom strongly typed HtmlHelpers in ASP.NET MVC
27 May 2011 by Anshul R
For Control Panel:Process.Start("control.exe");For My Computer:Process.Start("explorer.exe", Environment.GetFolderPath(Environment.SpecialFolder.MyComputer));For the rest, we can use GUID just like the original.For Recycle...
28 Dec 2014 by Pritam Deshmukh
This tip elaborates few useful tricks and shortcuts of VS 2013 mainly for professional edition (You can find them with Ultimate version too).
30 May 2012 by Ahsan Murshed
This article gives ideas to developers to increase development time productivity using the free Visual Studio 2010 extensions.
22 Aug 2016 by Sujith Karivelil
Creating a link in the left pane of the file Explorer - like OneDrive or DropBox
27 Apr 2012 by Igor Pashchuk, MBA
This is an alternative for "C# Pivot Table"