Microsoft has shipped the ASP.NET MVC 1.0 Release Candidate (RC). Click here to download it. It works with both Visual Studio 2008 and Visual Web Developer 2008 (which is free). This RC is the last public release of ASP.NET MVC that we’ll ship prior to the final “1.0” release. Microsoft is expected to ship the final ASP.NET MVC 1.0 release next month. |
|
|
|
Written by Talha Kalim
|
|
Wednesday, 25 February 2009 20:19 |
|
Well knowing that there are many tutorials out there that will be able to help you with basic C# coding, I am writing this tutorial as a precursor to the C# client server programming tutorial. This tutorials will be followed by the C# events, delgates, and threading tutorials which we will be using later on in our client server programming tutorials.
Lets start with a simple hello world program which containd some basic constructs you will find in a C# program.The program may not really make much sense but I hope it gets through with the concepts. I am obviously going to assume here that you have some prior knowledge of object orientated programming concepts.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// lets just import sum packages we may need
using System;
public class Hello
{
public static void Main()
{
//lets define an object of the class below
SomeClass nothing = new SomeClass();
SomeClass freshnova = new SomeClass(1, "FreshNova");
// lets define some useless arrays and variables
int number=0;
String name = "Talha";
String[] details={"Talha Kalim", "C# Getting Started"};
int[] numbers= {1,2,3,4,5,5,7};
// Naaa lets use a loop to initialize that
for (int i =0; i<5; i++)
{
//just multiplying index by ten and putting in array
numbers[i]=i*10;
}
//just writing some text to the console
Console.WriteLine("Hello, World!");
//lets read some text form console and write to console
Console.WriteLine("Please enter some text:");
String input=Console.ReadLine();
Console.WriteLine(input);
}
}
public class SomeClass
{
// Some private fields
private int number;
private String name;
// Public property to get and change the value of private fields
public int Number
{
get { return number; }
set { number = value; }
}
//a simple consructor
public SomeClass()
{
// lets intialize the variables
number=0;
name="freshnova";
}
//a more useful consructor
public SomeClass(int number, String name)
{
// lets intialize the variables
this.number=number;
this.name=name;
}
}
|
Well I suppose thats the most basic stuff that you have in any C# class. I will obviously define any concepts that are introduced later. I hope this is enough to brush some of the basics. Please do search for more details on concepts that are not clear, or just post a comment and I will try my best to help you out. Please provide us with feedback on how to improve and well if there are any discrepancies in the code above, please do let me know, so I can fix it. After all we all make mistakes, and we are ways learning...
|
|
Last Updated on Thursday, 26 February 2009 00:38 |
Copyright © 2009 FreshNova, by Talha Kalim and Waleed Al-Bahrawy
Comments