Friday, October 23, 2009

C# MSDN

http://msdn.microsoft.com/en-us/library/x9afc042.aspx

C# Language Specification
http://msdn.microsoft.com/en-us/library/ms228593.aspx

C# Programming Guide
http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx

Encapsulation

http://www.c-sharpcorner.com/UploadFile/ggaganesh/EncapsulationInCS11082005064310AM/EncapsulationInCS.aspx

C# provides accessor methods (get and set methods) which are used to achieve the encapsulation in the C#.

There are two ways of encapsulating or hiding the data.

1. CREATING METHODS TO HIDE DATA

public class LogInToken
{
private string Name;
public string GetName()
{
return Name;
}
public string SetName(string s)
{
Name=s;
}
}
2. USING PROPERTIES TO HIDE DATA

public class LogInToken
{
private string name;
public string Name
{
get
{
return name;
}
set
{
name = value; // C# uses the implicit parameter "value"
}
}
}

Wednesday, October 14, 2009

OOPS Concepts

http://www.dotnetspider.com/forum/105237-what-data-abstraction-data-encapsulation.aspx
http://www.csharp-station.com/Links/ShowLinks.aspx?cat=CSharpSites&title=C%20Sharp%20Sites

Inheritance
http://www.c-sharpcorner.com/UploadFile/grusso/ImplInherit12032005000508AM/ImplInherit.aspx

Encapsulation
http://www.c-sharpcorner.com/UploadFile/ggaganesh/EncapsulationInCS11082005064310AM/EncapsulationInCS.aspx

Polymorphism
http://msdn.microsoft.com/en-us/library/ms173152.aspx

Edit Manifest of an assembly - ildasm

http://www.codeproject.com/KB/msil/ManifestEdit.aspx

In an assembly, a method is of private but it needs to be changed into public so that anyone can get access to it.

Data Abstraction

Data abstraction refers to, providing only essential
features by hiding its background details.
example:
class result
{
int marks;
float percentage;
char name[20];
void input();
void output();
}

main()
{
bank b1;
b1.input();
b1.output();
}

in the above example, b1 is an object calling input and
output member functions, but that code is invisible to the
object b1.

Forums

http://www.itags.org/dotnet/480010/

Thursday, October 8, 2009

Start day, dayname and end day of the month

http://anuraj.wordpress.com/2007/12/03/last-day-and-first-day-of-the-month-using-c/

//Get startday of month
DateTime firstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

//Get endday of month
DateTime.DaysInMonth(DateTime.Now.Year,DateTime.Now.Month)

if day is 1 of any month use DateTime.Now.DayOfWeek returns dayname
else DateTime.Now.AddDays(-(DateTime.Now.Day-1)).DayOfWeek returns dayname