C# Corner

Resources  
  • Shuffle Game for BeginnersJan 05, 2000. This code sample is a GDI+ shuffle game aimed for beginners. Attached zip file includes the exe and the Shuffle.cs file.
  • Asynchronous Request in .NET (C#)Jan 09, 2000. This code sample shows how to call a COM component in .NET framework using C#.
  • Symmetric Encryptor Beta1Jan 11, 2000. Free to use Encrypt/Decrypt using 2 Symmetric Algorithms 'DES' and 'RC2' coded in C#.
  • Use C# to write comments and documentationJan 12, 2000. Comments and Documentation is one of the most hated tasks by programmers. By using C# programmers can can automatically builds the documentation and comments in the code. This documentation is a XML file which is more or less self explanatory.
  • I'm having trouble implementing IObjectSafety. IE keeps telling me that my controls isn't safe. Why?Aug 15, 2000. This article explains about how to implement the IObjectSafety. ATL's IObjectSafetyImpl class appears to have a few bugs in it. The code below works great.
  • C# EditorsOct 06, 2000. You can write your C# code with various editors including your favorite text editor Notepad. See more editors here.
  • A Simple Calculator ClassNov 28, 2000. Code sample shows how to create a simple calculator class and call it from Main C# program.
  • Browse or Open a FileDec 15, 2000. This sample code show you how to use OpenFileDialog class to open or browse a file.
  • Adding Menu Support to a Windows FormDec 18, 2000. This sample code shows you how to use the MainMenu and MenuItem classes to add a menu and click handler for a Windows Form.
  • Calling a COM Component From C# (Late Binding)Jan 08, 2001. This code sample shows how to call a COM component in .NET framework using C#.
  • Developing 3-Tier Applications in C# and .NETFeb 04, 2001. The attached sample code explains for beginners, how to Code for a 3-Tier Architecture.
  • Synchronization in Multi-threadingFeb 13, 2001. This article with sample code shows synchronization concepts of multithreading ..
  • Adding Items to a ListBoxMar 06, 2001. Sample code shows you how to add items to a list box.
  • Testing .Net Components Using NUnitMar 08, 2001. Write unit tests before starting development". Writing test allows me to see immediate results of every code change.
  • Serialization Sample CodeMar 13, 2001. A class on serialization.
  • Writing Secure Code using C#Apr 06, 2001. Code access security is a mechanism that grants/denies access to resources within a method call. For example, code written by a person may be allowed to write to the disk while code from another one may be forbidden from accessing the disk. This control can be enforced even if the code written by both of them is used within a single application
  • Protecting IL Code from unauthorised DisassemblingApr 09, 2001. Microsoft .NET proved a mechanism where the code written in VB.NET, C# or any CLS compliant languages to generate MSIL (Microsoft Intermediate Language)code which targets the CLR and executes. This is an excellent mechanism to abstract the high level code from the underlying hardware.
  • Naming Guidelines in .NETApr 20, 2001. Commenting and following a uniform naming guidelines in your code is one of good programming practices to make code more useful.
  • Understanding How Assert Effects SecurityApr 25, 2001. Assert is a security action that is evaluated at run time. Code Access Permission classes and Permission Sets support a method called Assert. Using the Assert method to control access to resources or actions will allow your code to perform actions that it normally has permission to perform and will allow other callers up stream in the call stack to have access that they would not normally have.
  • XML Strengths and Weaknesses with DOM, ASP, and XSLApr 30, 2001. In this article we're going to take a look at some of the terminology that comes with using XML and its related technologies, as well as how to create and transform XML documents with XSL using Microsoft's MSXML parser. To test the code samples shown in this article you should be running Windows NT/2000/XP with IIS installed. You should also have SQL server 2000 installed on the same machine.
  • Defining Custom Entry PointsApr 30, 2001. In this article i am going to demonstrate how we can manipulate the IL code to change the behaviour of how the .NET programme executes.
  • Viewing Assembly PermissionsMay 02, 2001. In this article I will show you how you can view the Code Groups that an assembly belongs to and what permissions belong to the assembly. I will demonstrate the Caspol utility supplied with the .NET SDK.
  • Connect to an Oracle DatabaseMay 03, 2001. This sample code shows you how to connect to an Oracle database using C#.
  • Operator Overloading ExampleMay 14, 2001. The code uses the feature of Operator Overloading in C#. It shows how different operators are overloaded and can be used in a easy manner.
  • Mobile Fun with XMLMay 24, 2001. Here is something really wonderful in Mobile field .This example is for authenticating the Mobile Users against his settings stored in XML file. This is really good where all the ease of XML is applied. Function open the XML file and particular node data validate it against user inputs and do the specified.
  • Data Structure Sample ExampleJun 04, 2001. Source code for Data Structure implemetation of Stack, Queue, Doubly linked list and more..
  • Virchk.cs: A C# file Scan Utility for Generating MD5 Signature FootprintsJun 13, 2001. Virchk.cs is a file scanner utility, which traverses the files in a directory and all it's sub directories, to generate a MD5 hash signature footprint of the targeted extensions file.
  • .NET Brings The Fun Back to ProgrammingJul 11, 2001. Today, we are all comfortable sitting in front of our high powered computers running graphical user interfaces and compiling code in sophisticated development environments.
  • XML as Middle TierJul 12, 2001. There is always been a need that there will be an intelligent middle Layer between Database Server and the UI Code. There are many ways but one fantastic approach came in picture with the XML.
  • Scaling an ImageJul 13, 2001. This code will show You on way to scale an image with .Net Beta 2.
  • Using/Debug Option During CompilationJul 15, 2001. This source code below is an an example of how to use /debug option during compilation.
  • Compute Feature of DataTableAug 01, 2001. The following code is for implementing least known feature of DataTable Compute() method.
  • Message Box BuilderAug 14, 2001. This program will help you using MessageBox Class. Program generates code from what you choose.
  • Namespaces in C#Aug 20, 2001. Namespaces allow you to create a system to organize your code. A good way to organize your namespaces is via a hierarchical system.
  • Messaging between Threads using Message LoopAug 20, 2001. MessageLoopLib is a stripped down version of a complete, threading communication subsystem Ive written. This implementation is a single thread created in the GUI constructor. Ive dropped all thread management and have had to change some of the message code to accommodate this.
  • C# or VB.NET - World War IIIAug 23, 2001. In this article I'm going to go under the hood and show you what really happens to the in C# and VB.NET.
  • WhoIs Sample CodeAug 27, 2001. Sample example shows you how to implement WhoIs...
  • An insight into Code Reusability and COM Interoperability : Part IAug 28, 2001. Code reusability is the art of using existing code to achieve better productivity and ease of maintenance. The concept of reusability is not new. Its existence has been evident since the evolution of mankind.
  • Simple Game Developed in C#Sep 03, 2001. This article contains the code for a simple game developed using csharp. This game is all about arranging the shuffled numbers in ascending order.
  • Socket Programming in C#Sep 03, 2001. This program is useful for a starter who wants to write C# code using .Net Sockets.
  • Number to Currency ConvertorSep 03, 2001. The attached Num2Cur.cs file converts number to currency up to 999,999,999,999.9999 i.e (999 billion).
  • Simple Windows Forms Events and InterfacesSep 03, 2001. This article contains a c# code which makes use of the concepts of Events and Interfaces together.
  • Web Control BuliderSep 03, 2001. The attached C# program can be used by users who dont have VS.NET IDE to generate the code for WebControls.
  • Regular Expressions Usage in C#Sep 07, 2001. The source code shows how to use Regular Expressions in C#.
  • A variety of Chart EnginesSep 07, 2001. The original code came from Scott Guthrie’s chart engine example. The differences from original code.
  • Operator Overloading in C#Sep 10, 2001. The Source code below shows how to use Operator Overloading in C#. Operator Overloading is pretty useful concept derived from C++ by C#.
  • Mouse and Key EventsSep 11, 2001. This article explains the usage of key and mouse events. The following code shows you how you can read mouse position on mouse move.
  • Doppler RadarSep 14, 2001. This is an app that will display the current doppler radar picture for any given zip code.
  • Using Attributes in C#Sep 14, 2001. This article shows how to create custom attribute classes, use them in code, and query them.
  • Playing with StringsSep 18, 2001. This program explores the String class and its various methods. With this you will be able to initialize strings using different constructors and use them. To see how the methods of the 'String' class work, see the following code.
  • Constructor, Destructor and ILASMSep 20, 2001. I find C# a very interesting language and it also comes handy to analyze ILASM code.
  • Accessing Oracle DatabaseSep 21, 2001. This source code shows you how to connect to an oracle database and do operations such as select, insert, update and delete.
  • MDI Forms in C#Oct 18, 2001. This article show how to create the MDI Form. The following source code will provide the use of MDI Forms in C#.
  • Checked ListBox Control In C#Oct 18, 2001. The following source code will provide the use of CheckedListBox Control In C#.
  • Using TreeView ControlOct 23, 2001. The following code will enumerate the Folder/Drives in the TreeView Control.
  • Pointers in C#Oct 25, 2001. C# also supports pointers in a limited extent. A pointer is nothing but a variable that holds the memory address of another type. But in C# pointer can only be declared to hold the memory address of value types and arrays.
  • Exceptions and Exception StackNov 16, 2001. The purpose of this tutorial is to explain firstly how you would go about creating your own set of exceptions to trap error conditions that could occur in your code or library, for your own benefit or for the benefit of another developer using your library. The second lesson is on how the C# exception stack works, and how you can use it to catch all types of exceptions.
  • An insight into Code Reusability and COM Interoperability - Part 2Nov 26, 2001. We have mushrooms of network systems running across the globe based on many proprietary protocols. In order to integrate these systems to communicate with each other in a more meaningful way, developers or organizations have to face an uphill task.
  • Creating a Custom Data AdapterDec 03, 2001. A good programmer needs to know how to work with ADO.NET DataAdapters at the code level.
  • Using ProgressBar, StatusBar and Timer Controls in VS.NETDec 05, 2001. This source code shows how to use the Timer, ProgressBar and StatusBar Windows Forms controls.
  • Debug Troelsen's .NET books (1): IEnumeratorDec 10, 2001. This article examines code problem in chapter 4 (for C#)/chapter 5(for VB.Net) of the two .Net books.
  • Using ADO RecordSet in ADO.NETDec 10, 2001. Using ADO recordset in managed code using ADO.NET data providers is pretty simple. Visual studio .NET provides you to add reference to the COM libraries. In this article I'll show you how to access data using ADO recordset and fill a ADO.NET data provider from the recordset data.
  • C# and ActiveX DLLDec 14, 2001. As you know with Visual Basic 6.0, it is possible develop a COM server and implement them in a Visual Basic client program. But this is being done by using Visual Basic. You may wonder about the idea of calling this DLL in a C# Application. Well, C# language provides us a way to call this COM server in a program. When we compile a C# program an Intermediate Language is generated and it is called as Managed Code.
  • How Can You Migrate your Existing Applications?Dec 20, 2001. When a new technology emerges, companies and developers begin to wait anxiously for answers to their questions.
  • Space Invaders in C# and .NETDec 23, 2001. Yes, the classic arcade game has returned and is appearing in C# Corner complete with sound and authentic aliens and source code. It's not quite as good as the real game, but with a few adjustments it can get there.
  • Creating Exploded Pie Chart Having Click Through Functionality in C#Dec 26, 2001. In this article I would like to show you code that would create exploded pie chart and implementing click through functionality to that chart.
  • A Quiz Application using Windows FormDec 27, 2001. This code shows you how to validate data in windows forms, add or remove panel control, and write a form based quiz application.
  • Exception Handling in C#Jan 03, 2002. In C# Exception is a class in the system namespace. An object of an exception is that describe the exceptional conditions occur in a code That means, we are catching an exception, creating an object of it, and then throwing it. C# supports exceptions in a very much the same way as Java and C++.
  • Buliding Text to Speech Applications using SAPI 5.1 and C#Jan 03, 2002. In this article,The Speech application programming interface (SAPI) considerably decreases the code necessary for an application to use speech recognition and text-to-speech, making speech technology more handy and robust for broad range of applications
  • Basic FTP in C#Jan 10, 2002. FTP client developed using Windows Forms. The source code uses a rigid Model-View-Controller design pattern.
  • C#RIS : Tetris Game in C#Feb 14, 2002. I have written a Tetris clone that demonstrates how to use off-screen graphics buffering for smooth animation and utilizes a multi-dimensional array approach to designing a game grid. The classes are largely self-explanatory and the techniques are documented in code well enough to explain what is going on.
  • N-Tier Development with Microsoft .NET : Part IFeb 15, 2002. The purpose of this article is to examine a proof of concept on an architecture that follows the DNA pattern on concept only.
  • Saving and Restoring Location, Size, and Window State of a FormMar 01, 2002. This article presents a simple C# class that may be added to a form to automatically do this. When I designed this class I wanted to be able to add it to a form using the least amount of code and also be able to add it to a form from the toolbox.
  • Calling Managed Code from Unmanaged CodeMar 11, 2002. One significant part of developers (including myself) are doing some kind of automation of Microsoft Office. So I will concentrate on opposing side of problem, how to use managed assembly from MS Office or VB script. In this article, I will discuss how to call managed code from unmanaged code.
  • JIT CodingMar 11, 2002. One not so well known feature of .NET platform is possibility to invoke compiler and practically create code and assembly from running instance of application. It is possible to do that in two ways. First one is a bit simpler and involves namespaces System.CodeDom and System.CodeDom.Compiler, second one is more efficient and utilizes namespace System.Reflection.Emit. Since there are very few examples about how to use System.CodeDom.Compiler I will start with it.
  • Drawing rubber-band lines and shapesMar 12, 2002. I would like to show how we can draw rubber-band lines and shapes in GDI+ with just a few lines of code.
  • Creating a SQL Server Database Programmatically using SQLDMOMar 12, 2002. The attached source code creates a SQL Server database programmatically using SQLDMO.
  • Sending Windows Message in C#Mar 14, 2002. This sample code shows how to send Window messages between two forms using C#.
  • C# to VB.NET Code Conversion Web ServiceMar 20, 2002. ConvertCSharp2VB is a Web Service that converts a C# code block into VB.Net. It exposes the Service Description and WSDL for the Web Service, so you can implement this functionality in your applications.
  • Simple NSLookUp Implementation in C#Apr 01, 2002. This is code implementation for simple nslookup. As you can see from the code listing, I've used classes defined in the System.Net namespace.
  • Multicasting using UDP in C#Apr 04, 2002. The attached source code shows you how to use multi casting in a LAN environment.
  • Tracking Time in a Window ApplicationApr 15, 2002. The program reads from an XML file to get the data about names and birth dates, so it is easy to add or remove names without changing the code in case my son decides the program should include his pet dog or turtle.
  • Drawing B-Spline CurvesApr 22, 2002. The attached source code project draws spline curves between two points.
  • .NET Security in C#Apr 22, 2002. This article shows how to make file I/O access be denied if the user running the application did not have administrator privileges.
  • Application Data Utility ClassApr 24, 2002. Attached is a ZIP file containing the source-code and compiled DLL of the "Application Data Utility Class".
  • MP3 JukeBoxApr 30, 2002. This is stable code and more generic than the first release. It has better error handling now to make it more 'idiot proof'.
  • Interrogating Your Printer Queues with WMIMay 20, 2002. In response to a newsgroup query here is the code needed to view the printer queues on your system.
  • CS CODEDOM ParserJun 12, 2002. CS CODEDOM Parser is utility which parses the C# source code and creates the CODEDOM tree of the code(general classes that represent code, part of .NET Framework - namespace System.CodeDom).
  • An Editable GridView Control in C# and .NET - Part II Persisting in XMLJun 19, 2002. In this article we will take advantage of the XML classes available to us to persist the GridView control that we talked about in our first article in this series. The two classes we utilize in our code are XmlTextWriter and XmlTextReader.
  • An Editable GridView Control in C# and .NET - Part IIJun 19, 2002. In this article we will take advantage of the XML classes available to us to persist the GridView control that we talked about in our first article in this series. The two classes we utilize in our code are XmlTextWriter and XmlTextReader.
  • Using Currency Manager and MemoryStream to Display ImagesJul 01, 2002. This article and attached sample code demonstrates you how to use the CurrencyManager and MemoryStream to display images.
  • Use CurrencyManager and MemoryStream to Display ImagesJul 01, 2002. This article and attached sample code demonstrates you how to use the CurrencyManager and MemoryStream to display images. The current demonstration displays all the records of the employees with their company and the personal Information.
  • Create FTP and Web IIS Virtual Directory using C#Jul 03, 2002. In this example we will create a Windows Form Project that will create new FTP and Web IIS Virtual Directories from code based on the name and path specified by the user.
  • Deploying a COM Component from C#Jul 08, 2002. Here is some code to help you to deploy a COM component from C#. I needed to programmatically deploy a project that would be registered as COM object (not COM+) and be installed into GAC. The following two classes will help in this objective.
  • Using MSIL Code to Close Application ProgrammaticallyJul 18, 2002. You can use MSIL code to call Win32 APIs and one of the simplest example of it is by closing an application programmatically.
  • Web Forms Code ModelJul 23, 2002. ASP.NET introduces a new programming model for Web Forms to separate the code and visual elements in different files.
  • Using Active DirectoryJul 31, 2002. This sample code can sense current context in Active Directory, checks for the existence of attributes, provides a list of all the attributes in Active Directory and can add a user to Active Directory.
  • CoolLayout .NET: A Windows Forms ComponentAug 02, 2002. CoolLayout.NET is design time enabled .NET component which helps to create professional forms with no coding efforts.
  • Validation Server Controls in Web FormsAug 05, 2002. When working with Web applications, developers need to write two separate codes using Java Script and VB Script to validate user inputs.In this article we are going to see, how we can reduce the programmers effort on coding, reducing the execution process time and simplify the code handling and less number of lines in the coding.
  • Code InternationalizationAug 06, 2002. This is a very simple windows application example for localizing the application. Visual studio .NET makes it pretty simple to create localized applications and manage them.

About CSS-Code

NA
File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!
Download Free eBooks