Logo      
 
Total Source Downloaded: 99,295
 
Total Snippet Views: 59,399
 
New Member: alnahas1
     
Home Tutorials Register Members Submit Snippet  
My Account
Username
Password
Site Information
Members
393
Total Downloads
142
Total Snippets
132
Downloads
C#
66
Java
54
Python
8
Visual Basic.Net
14
Snippets
C#
52
Java
48
Python
13
Visual Basic.Net
19
Submit your source code and code snippets to Cy2online and help build an archive of source code. Click here register or login if you are a member.
Submit Snippets
New Tutorials
Tutorial Language
ASP.Net C# MessageBox C#
Connecting To A Network Time Server C#
A Very Simple Oracle Query Tool C#
Simple introduction to Oracle XE with C# C#
How To Populate A DataGridView Control Using OleDbDataReader C#
Creating A Custom Message Box In C#: Part 2 C#
Creating A Custom Message Box In C# C#
New Uploads
    Title Language Downloads
1 Custom Button C# 88
2 Thread Example Using Lock C# 86
3 Simple Interface Example C# 92
4 Control Arrays C# 85
5 Drag And Drop Example 1 C# 96
6 Migrate Date From SQL Server To MySQL C# 44
7 ASP C# Web MessageBox C# 969
8 Simple JTable Example Java 149
9 DataGridView With ComboBox Example 1 C# 544
10 Simple Serializable Example C# 258
New Snippets
    Title Language Views
1 Screen Capture C# 53
2 Get System Time Python 36
3 Display A Message Box Python 49
4 Get Elements By Tag Name Visual Basic.Net 54
5 Boxing And Unboxing Example C# 46
6 Interface Example C# 92
7 Sort array C# 247
8 Get NetBIOS and DNS computer names C# 263
9 Get a Type reference C# 151
10 Clone an array with Array.Clone C# 152
57 Rectangle Class - Java
Version: JRE 1.4
This snippet contains 2 class's with two main methods. You need to save the seperatly. The snippet demonstrates how to draw a rectangle.
Import/Using Directives
None
public class Rectangle
{
private double width = 1;
private double height = 1;
private static String color = "white";
public Rectangle() { }
public Rectangle(double w, double h, String c)
{
width = w;
height = h;
color = c;
}
public double getWidth() { return width; }
public void setWidth(double w) { width = w; }
public double getHeight() { return height; }
public void setHeight(double h) { height = h; }
public static String getColor() { return color; }
public static void setColor(String c) { color = c; }
public double findArea() { return height * width; }
}

// ClientProgram.java


public class ClientProgram
{
public static void main(String args[])
{
Rectangle mySquare = new Rectangle(5, 5, "green");
System.out.print("\n Height = " + mySquare.getHeight() );
System.out.print("\n Width = " + mySquare.getWidth() );
System.out.print("\n Color = " + mySquare.getColor() );
mySquare.setHeight(10);
mySquare.setWidth(15);
System.out.print("\n\n Height = " + mySquare.getHeight() );
System.out.print("\n Width = " + mySquare.getWidth() );
System.out.print("\n Area = " + mySquare.findArea() );
}
}
1 Simple DataGridView Example - C#
This example demonstrates how to load data into the DataGridView control using string array's.
2 A Custom Message Box - C#
This example source code demonstrates how you can develop your own messages box.
3 Custom MessageBox 2 - C#
This example source code builds on a previous example of creating a custom MessageBox. New features in this example include different types of buttons and displaying an icon. Also uses different message beep tones for standard MessageBox's and warring MessageBox's.
4 Connect To MSN Messenger Using The MSN Protocol - C#
This sample application demonstrates how to connect to MSN Messenger using the MSN Protocol. It also includes how to generate a Ticket that is used with the ChallengeString. This is a simple authentication example.
5 Send Messages Using The Net Send Command - C#
This sample program demonstrates how to send messages in a network using the Windows Messenger service.
1 Transfer data from CSV file to MySQL - Java
This snippet transfers deliminated data from a CSV file to a MySQL database. You need to edit the code to include your database connection details and also the fields from the CSV and MySQL needs to correspond with your fields.
2 Retrieve the path of a file, using openfiledialog - C#
This snippet uses the openfiledialog class to get a files path. Useful for opening files from a location on the harddrive.
3 Read Image File As bytes - C#
This sinppet opens an image for reading as bytes. The bytes are then placed into a memorystream which is used to create a bitmap image of the bytes. The image is then set as the forms background image.
4 Random Number Generator - Visual Basic.Net
Function that reurns a random non-repeating integer
5 Load web image into picturebox - Visual Basic.Net
Function with picturebox and url as argument to display the passed url to image inside a picturebox I got this from freevbcode a while back.
CY2 Online2.net | CopyRight 2005 - 2007 | All Rights Reserved