Code Execution stops with no error

2019-08-03 06:45发布

In my Form1_Load event, the code execution stops for no reason the middle of nowhere, and just finishes the loading process at that instance, showing the gui, this is the code and the line where it stops:

Downloadn("https://somelinkhere.com/file.txt","Init.txt");
        Application.DoEvents();
        List<string> links = new List<string>();
        var lines = File.ReadAllLines("Init.txt"); //Code Stops and Gui Shows up after executing this code
        links.Add(lines[0].Split('^')[1]);
        links.Add(lines[1].Split('^')[1]);
        links.Add(lines[2].Split('^')[1]);
        links.Add(lines[3].Split('^')[1]);

The debugging process shows no errors, what could i be doing wrong ?

1条回答
小情绪 Triste *
2楼-- · 2019-08-03 06:59

I wonder if an exception is being caught and swallowed somewhere, since by the sounds of it the program doesn't crash it merely skips some code. In Visual Studio, go to Debug\Exceptions, tick all the Thrown boxes and try again. If my suspicion is correct, this will identify the problem.

查看更多
登录 后发表回答