Hel*_*der 0 c# crash for-loop system
我只是一个傻瓜谁发现这样的kiddy脚本工具迷人:)
for(i = 0; i < 100000000000000000000000; i++)
{
System.Diagnostics.Process StartTheKill;
StartTheKill = new System.Diagnostics.Process();
StartTheKill.EnableRaisingEvents = false;
string TheCommand;
TheCommand = "/C tree C:/";
System.Diagnostics.Process.Start("CMD.exe", TheCommand);
StartTheKill.Close();
}
Run Code Online (Sandbox Code Playgroud)
我的老师对此很困难,因为它是检查故障硬盘的好工具.我只是想知道这个循环是否足以使PC崩溃或对硬件造成永久性损坏......
我怀疑这甚至会使机器崩溃.
每个进程都需要一些内存,你很快就会耗尽内存,此时操作系统将拒绝启动任何更多的任务.你可能会看到关于虚拟内存不足的好对话.
损坏硬件?你一定是在开玩笑.