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

C# 2.0

C#2.0

Great Reads

by Jeffrey Walton
Import and export Cryptographic Keys in PKCS#8 and X.509 formats, using Crypto++, C#, and Java.
by Dark Daskin
Article describes how to build an assembly that exposes functions to unmanaged code without C++/CLI
by Waleed Elkot
Reading text from any image using Microsoft Office 2007 OCR
by Josh Smith
Reviews a pattern which enables new possibilities for data binding.

Latest Articles

by Shivprasad koirala
Design Pattern FAQ - Interview Questions (Quick Reference)
by Claudio Nicora
An extended NumericUpDown control with better focus and mouse wheel management.
by Toby Patke
Clearcove.Logging is a very simple logging library designed to meet most logging needs with straight-forward licensing terms.
by Alexander Iacobciuc
In this article you will find an implementation of a stream player control.

All Articles

Sort by Score

C# 2.0 

13 Jun 2011 by Ctznkane
The Array class already contains this capability with no casting required. The IndexOf method is a static one that returns the index of the value and a -1 if it doesn't exist.Here is an example:exists = Array.IndexOf(arr, "item") >= 0
17 Aug 2012 by Arman Aşçı
Parallel port data register control with C# .NET 2.0 and inpout32.dll.
20 Jun 2011 by Kiran Sonawane
A trick when using Array.Contains()
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
28 Apr 2015 by Hassan Alrehamy
JSON Deserialization in depth concept and Dictionary mapping. Special Thanks to Dr. Coral Walker
6 Sep 2010 by DaveyM69
How to convert a generic List of derived types to a generic list of base types.
6 Apr 2011 by intrueder
My alternate uses the AddBezier method, and the size of the heart adjusts to the size of the form.private void Form1_Load(object sender, EventArgs e){ using(System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath()) { path.AddBezier(...
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 Jun 2011 by VallarasuS
Here is how you can achieve Gradients used in Office 2010 Buttons with a glow at the bottom.
14 Feb 2014 by BenScharbach
How-To Convert a String Collection to a Multi-Enum item using TryParse
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
17 Dec 2012 by AshishChaudha
This tip describes the working of DetailsView for inserting a new record, updating and deleting the existing details of the user.
9 May 2013 by Abhay@Accenture
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();}
21 Sep 2011 by Anshul R
Private Sub GetIPAddress()Dim strHostName As StringDim strIPAddress As StringstrHostName = System.Net.Dns.GetHostName()strIPAddress = System.Net.Dns.Resolve(strHostName).AddressList(0).ToString()MessageBox.Show("Host Name: " & strHostName & "; IP Address: " &...
27 Nov 2011 by johannesnestler
I'd like to offer a "funny" alternative by using a dummy TextBox. public static Bitmap GetPlainTextBitmap(string strText, Font font, Color colorBack, Color colorText, Size sizeTargetBitmap) { // Create a dummy TextBox TextBox txDummy = new TextBox(); ...
18 Feb 2012 by Sajid Asghar
How to insert Data in SQL server via SqlDataSource in ASP.NET
5 Jun 2012 by Andreas Gieriet
This is an alternative for "Sorting Strings based on the position of the block letter"
24 Jul 2012 by Sumon1524
Observu monitors your websites from multiple locations and combines it with measurements collected on your servers. Here this article will show how to send data to Observu.
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#
22 Sep 2011 by nlarson11
On Vista/Win 7, I have seen code where only a single period is returned for (0). This makes sure you get the actual IP regardless of the system.Const IPPattern As String = "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"With Dns.GetHostEntry(System.Environment.MachineName) Return...
18 Nov 2011 by Denno.Secqtinstien
protected void Page_Load(object sender, EventArgs e){ HttpBrowserCapabilities bc = Request.Browser; Label1.Text = "IP Address=" + Request.UserHostAddress;}
24 Nov 2011 by RayD111
Dim ipE As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName) Dim AL As Array = Dns.GetHostEntry(vWrkStn).AddressList Dim A As IPAddress For Each A In AL If A.AddressFamily = Sockets.AddressFamily.InterNetwork Then ...
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 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
25 Feb 2013 by ajaynarewade
This is helper class to post serialized objects (Data) to other page in asp.net.
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
17 Jan 2015 by LLLLGGGG
A really simple implementation of a C# menu for console applications
12 Mar 2010 by jp2code
Introduction...
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, ...
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...
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...
24 Jun 2011 by nainakarri
Debugger showing wrong source file when debugging in VS2005
1 Jun 2012 by CoperNick
How suprising can be conversion of decimals to bytes in C#
6 Jun 2012 by PIEBALDconsult
This is an alternative for "Sorting Strings based on the position of the block letter"
15 Apr 2013 by Lee Louviere
Convert joystick movement into mouse position from a fixed center.
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
13 Nov 2013 by BrokenEvent
Simple and fast .NET XML parser without using System.Xml
17 Dec 2012 by AshishChaudha
This tip describes how to export data to an Excel file from a GridView.
6 Apr 2013 by Thomas Daniels
A tip about how to set the position of a Windows Forms MessageBox in C#
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.
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).
12 Mar 2014 by apis3445
With C# and the Windows API, you can execute a program in a second monitor.
17 May 2011 by RaviRanjanKr
Convert Text to Image
28 May 2013 by akramKamal
Code to serialize/deserialize any object to an XML file.
5 Nov 2014 by Jeong, WonYoung(Brad)
Making BitField with C# alternative to BitField made with union and struct of C++
8 Apr 2011 by Brijesh Kr
How to disable Autorun C#
15 Feb 2015 by Yuri Heymann
Source code for the article titled "A Finite-Difference Model for the Thermal History of the Earth
1 Jan 2014 by Kees van Spelde
To encrypt or not to encrypt with C# .NET
16 May 2011 by J a a n s
For C# guys....using System ;using System.Runtime ;using System.Runtime.InteropServices ;public class Internet{ [DllImport("wininet.dll")] private extern static bool InternetGetConnectedState( out int Description, int ReservedValue ) ; public static bool...
13 Jan 2011 by DaveyM69
How to prevent a CD/DVD drive from being opened.
21 Oct 2013 by Sitang Ruan
Central jQuery Version Control
7 Feb 2012 by DaveyM69
How to have a real console window as well as your forms
1 Aug 2014 by Bryan Lyman
A method for duplicating a web page (including all scripts and styles) to run as if it originated from your own server, then modify server-side and client-side functionality afterwards.
6 Aug 2012 by Mukund Thakker
3 Jun 2013 by Philipp_Engelmann
This tip describes how to resize an existing image (e.g. uploaded by a user) so it does not exceed a defined size limit.
19 Feb 2014 by PallavSingh
How to run a website on one PC to another PC through IIS 8.0
13 Feb 2014 by Mik Wadstrom
Simple way to use Crystal reports as embedded dynamic printable reports
1 Oct 2013 by Rui Jorge Carvalho
Fast and simple Bitmap processor...
18 Dec 2013 by Sergey Morenko
Simple password generator, based on alphabets
21 Aug 2010 by DaveyM69
How to access a control from a different thread + good alternatives by other members!
17 Apr 2014 by gunjan k saxena
This tip will help to create an action filter to compress the contents like Json, partial view, etc.
22 May 2010 by DaveyM69
Enables access to the original argument in all events
20 Sep 2012 by Anuraj Parameswaran
Delete a file or folder to Recyclebin using C#
10 Dec 2013 by JRINC
Connect to remote socket via System.Net.Sockets.Socket.Connect method with timeout controlled by System.Threading.Timer
25 Oct 2013 by Monotosh Roy Mon
XML Serialization & Deserialization for converting our object to XML and XML to Object
13 Oct 2010 by linebenchmark
Remove all blank lines, containing or not spaces:^:b*$\n
14 Sep 2011 by Mohammad A Rahman
namespace IpAddresses{ using System; using System.Collections.Generic; using System.Linq; using System.Net; class Program { static void Main(string[] args) { GetIPAddresses().ForEach(ip => Console.WriteLine(ip)); } ...
30 May 2013 by Mohammed Hameed
Check-in/Check-Out mechanism for TFS - To avoid Build errors and improve productivity.
8 Apr 2014 by LShep
This tip describes an IEnumerable extension method that allows you to select an item modulo Count()
29 Mar 2011 by Brijesh Kr
8 Aug 2013 by Peter T. Ringering
A complete replacement to Microsoft's Date/Time Picker control.
6 Mar 2014 by Jacky Yiu
Visual cryptography is a cryptographic technique which allows visual information (pictures, text, etc.) to be encrypted in such a way that the decryption can be performed by the human visual system, without the aid of computers.
12 May 2012 by Md. Rashim Uddin
XML Serialization and Deserialization in c#
26 Nov 2014 by Sambhav Yadav - Sam D Silva
ASP.NET page/master page/user control's life cycle from the perspective of Session and View State
22 Mar 2011 by DaveyM69
Starting a thread using a generic argument
16 May 2013 by Pasan Eeriyagama
18 Aug 2014 by Emiliarge
Read and write data to Access databases without limitations caused by the use of the SQL.
27 Jul 2015 by Shru37
Modified code from another article to consider field repetitions while converting HL7 message to XML