c#控制台程序出现 无法创建新的堆栈防护页面 怎么破?

namespace Company
{
public class Employee
{
public Employee(string name, string educate)
{
this.name = name;
this.educate = educate;
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private string educate;
public string Educate
{
get { return educate; }
set { educate = value; }
}
public void Hellow1()
{
// string message;
// message = string.Format("大家好!我是程序猿{0},我的学历是{1}", this.Name, this.Educate);
Console.WriteLine("大家好!我是程序猿{0},我的学历是{1}", this.Name, this.Educate);
//Console .WriteLine (message);
// return message;

    }
} 
    amespace Company

{
public class Programmer:Employee
{
Programmer emp = new Programmer();
public Programmer ():base("aa", "bb") { }
public Programmer (string name,string educate,string prolanguage,string system,string datebase):base (name ,educate)
{
this.Name = name;
this.Educate = educate;
// 自己的属性
this.prolanguage = prolanguage;
this.system = system;
this.datebase = datebase;
}
private string prolanguage;
public string Prolanguage
{
get { return prolanguage; }
set { prolanguage = value; }
}
private string system;
public string System
{
get { return system; }
set { system = value; }
}
private string datebase;
public string Datebase
{
get { return datebase; }
set { datebase = value; }
}
public void Hellow()
{
Console.WriteLine("hellow!");
Console.WriteLine(" {0} ,我使用的编程语言是 {1} ,我的操作系统是 {2} ,我使用的数据库是 。", this.prolanguage, this.system, this.datebase);
Console.ReadLine();
}
}
}
static void Main(string[] args)
{
Programmer pro1 = new Company . Programmer("s", "本科", "C#", "Windows", "ACCESS");
pro1.Hellow1();
pro1.Hellow();
Programmer pro2 = new Company.Programmer("c", "本科", "C#", "IOS", "MSSQL");
pro2.Hellow1();
pro2.Hellow();
Programmer pro3 = new Company.Programmer("v#", "本科", "C#", "Windows", "MYSQL");
pro3.Hellow1();
pro3.Hellow();
Programmer pro4 = new Company.Programmer("a", "本科", "C#", "UNIX", "ORACLE");
pro4.Hellow1();
pro4.Hellow();
Console.ReadLine();
}

1个回答

public class Programmer:Employee
{
Programmer emp = new Programmer();
...

坏就坏在这里了。
你定义Programmer,然后在里面创建了一个Programmer
创建Programmer又需要在里面创建一个Programmer
...
于是就死了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐