using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ConsoleApplication9
{
class Contact
{
public DateTime DateOfBirth {
get { return DateOfBirth ; }
set { DateOfBirth = value; }
}
public string firstName
{
get;
set;
}
public string lastName
{
get;
set;
}
public string fullName { get { return this.firstName + "" + lastName; } }
public override string ToString()
{
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.AppendFormat("Name: {0}", this.fullName );
stringbuilder.AppendFormat("date of birth :{0}", this.DateOfBirth);
return stringbuilder.ToString();
}
}
}ctrl+F5时说无法创建新的堆栈防护页面,求高人解释。
还有一个program.cs代码没贴出来,需要的话我也贴出来
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ConsoleApplication9
{
class Contact
{
public DateTime DateOfBirth {
get { return DateOfBirth ; }
set { DateOfBirth = value; }
}
public string firstName
{
get;
set;
}
public string lastName
{
get;
set;
}
public string fullName { get { return this.firstName + "" + lastName; } }
public override string ToString()
{
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.AppendFormat("Name: {0}", this.fullName );
stringbuilder.AppendFormat("date of birth :{0}", this.DateOfBirth);
return stringbuilder.ToString();
}
}
}ctrl+F5时说无法创建新的堆栈防护页面,求高人解释。
还有一个program.cs代码没贴出来,需要的话我也贴出来
public DateTime DateOfBirth {
get { return DateOfBirth ; }
...
}
产生无穷递归导致堆栈溢出,改成
public DateTime DateOfBirth {
get;
set;
}
试试