Skip to content

Commit 88b94a3

Browse files
committed
changes
1 parent fccabd6 commit 88b94a3

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

DontRunMe/Program.cs

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,43 @@
88

99
string filename = $"{AssemblyDirectory}/DontRunMe.exe";
1010
{
11-
if (FourtyTwo(filename, args))
11+
try
12+
{
13+
foreach (var halted in FourtyTwo(filename, args))
14+
{
15+
if(halted)
16+
{
17+
break;
18+
}
19+
else
20+
{
21+
return;
22+
}
23+
}
24+
}
25+
catch (Exception)
26+
{
1227
for (; ; );
13-
else
14-
return;
15-
}
16-
catch (Win32Exception)
17-
{
28+
}
1829
for (; ; );
1930
}
2031

21-
bool FourtyTwo(string filename, string[] args)
32+
33+
IEnumerable<bool> FourtyTwo(string filename, string[] args)
2234
{
23-
var process = Process.Start(filename, args);
24-
process.WaitForExit();
25-
return true;
35+
yield return true;
36+
//try
37+
//{
38+
// var process = Process.Start(filename, args);
39+
// while (!process.HasExited)
40+
// {
41+
// yield return false;
42+
// }
43+
//}
44+
//catch(Win32Exception)
45+
//{
46+
// yield return true;
47+
//}
2648
}
2749

2850
string? AssemblyDirectory()

0 commit comments

Comments
 (0)