| Home : Programming : C# |
| Click "Subscribe" if you want to be notified of new or updated links in this category. | Subscribe |
|
|
C# Listings
|
|
Total:
59 | Displaying: 21 - 30 | Pages: << 1 2 3 4 5 6 >> |
|
|
|
When I started learning C# half the time I was trying to find Java equivalents so that I can learn effectively, leveraging my existing Java skills. At times I was so frustrated by my knowledge or lack there of. I'm penning this piece in the hope that my experience might help Java programmers to learn Java's new cousin (or villain according to some view points!). I'll only deal with those functionalities which are present in Java but are modified / changed completely in...
Updated: 03/13/2005
|
|
|
Here is an example of how the DateTime Structure works for C#. It's extremely basic and very easy to follow. /* This program finds out your Age using the DateTime structure in C#. */ using System; class DOB{ private DateTime dtDob; private DateTime dtNow; private DateTime dtAge; private int intDay; private int intMonth; private int intYear; private int intHour; private int intMinute; private TimeSpan tsAge; private int intAgeYear; private int intAgeMonths; private int...
Updated: 03/13/2005
|
|
|
Structures in C#: - ==================== Example: - ========== class TestStruct { public static void Main() { SimpleStruct st = new SimpleStruct(4); System.Console.WriteLine(st.i); st.aMethod(); } } struct SimpleStruct { public int i; public SimpleStruct(int j) { i=j; } public void aMethod() { System.Console.WriteLine("Inside aMethod"); } } O/P 4 Inside aMethod Features of Structures: - ========================== * A structure or struct can contain only fields, methods, Etc., * In...
Updated: 03/13/2005
|
|
|
When you create a C# class, you can make it available as a COM object to code outside of the VS.NET framework. This is done through use of the utility REGASM. REGASM creates a COM Type Library that describes the COM aspects of the class for use by both early binding in C++ (through #import directives) and late binding systems (such as VB6, through project references), and registers the COM class in the Registry under the HKLMSoftwareCLSID hierarchy. However, every...
Updated: 03/13/2005
|
|
|
Interface implementation can be confusing... I see a feature in C# that can be very confusing. In the example below we have a class (Test) that implements 2 interfaces (I1 and I2). So the logic says that we should have implementations in the class Test for both MyFunction() methods from I1 and I2. BUT! As you see in the example below everything works fine with only 1 implementation. This is not as correct as we expect, because we can't be sure which of the two interfaces...
Updated: 03/13/2005
|
|
|
This small application will give idea about Time Zone in c#, .Net platform having Class name called TimeZone in System Name space, TimeZone is abstract Class so we can't create instants of TimeZone , but Time TimeZone having Method called as CurrentTimeZone it returns number of properties. Download the Mytimez.cs file and run
Updated: 03/13/2005
|
|
|
This is a small CGI Aplication built with Visual C# .Net Beta 2, to test this application you must have at least SQL Server 7 (running Northwind database) and IIS 5.0 installed. Steps to test the application: 1- Create an account for the Internet Users in SQL 7 (normally IUSR_YourComputerName). - Open SQL 7 "Enterprise Manager". - Go to "Security" right click in "Logins" (a context menu will appear). - Click "New Login". Then SQL Server Login Properties will appear. -...
Updated: 03/13/2005
|
|
|
With this project you get idea about. 1. How to use various dialogs in C#. -For opening and saving file -For changing Forecolor and Backcolor -For Print-Layout and Printing 2. How to do copy/paste using clipboard and without clipboard.(Code commented for w/o clipboard) 3. How to use windows registry for saving default setting of notepad. 4. Reading and writing text file. Download all source/files
Updated: 03/13/2005
|
|
|
This sample shows a simple custom collection implementation in C# with the .NET Framework. using System; using System.Collections; namespace Personal.Demos.Simple{ public class MainApp{ //entry point 'Main' public static void Main(){ //get us some Widgets Widgets MyWidgets = Initialize(); Console.WriteLine("Using 'foreach' - "); //enumerate through the collection with //the foreach constuct. foreach(Widget W in MyWidgets){ //call the same method on each item in...
Updated: 03/13/2005
|
|
|
In C# also inner classes are possible. The program code demonstrates the implementation of inner classes and structures in classes. If we want to create an instance out side the class the inner class and inner structure should be public. Unlike java there will only one EXE is created, but in java more than one class files will create. The following program is self explanatory with proper output //Here Demonstrating class ,innerclass and inner structure //Demonstrating...
Updated: 03/13/2005
|
|
|
C# Listings
|
|
Total:
59 | Displaying: 21 - 30 | Pages: << 1 2 3 4 5 6 >> |
|
|