Hi,
I would really appreciate some help please with the code below. I created a new project, added a button to a form and put the code below in the click event. When I run it and click the button, after a short while my computer crashes with the Blue Screen Of Death. I have no idea why this should occur.
Initially I thought the default degree of parallelism (no maximum) may have been the issue, however, as you can see with the following code, the maximum parallelism is set to 1. This does not make any difference on whether the machine crashes which blows my suspicion out of the water.
I am running VS2010 on Windows 7 64bit. The program was compiled under .Net Framework 4.0.
I would be grateful for your comments and thoughts please.
Kind regards.
I would really appreciate some help please with the code below. I created a new project, added a button to a form and put the code below in the click event. When I run it and click the button, after a short while my computer crashes with the Blue Screen Of Death. I have no idea why this should occur.
Initially I thought the default degree of parallelism (no maximum) may have been the issue, however, as you can see with the following code, the maximum parallelism is set to 1. This does not make any difference on whether the machine crashes which blows my suspicion out of the water.
I am running VS2010 on Windows 7 64bit. The program was compiled under .Net Framework 4.0.
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ParallelOptions As New ParallelOptions
ParallelOptions.MaxDegreeOfParallelism = 1
Parallel.For(1, 254, ParallelOptions, Sub(x)
Dim Addr As String = "10.1.1." & x.ToString
Dim Result As String
If My.Computer.Network.Ping(Addr) Then
Result = "Alive"
Else
Result = "Dead"
End If
Console.WriteLine(Addr & " " & Result)
End Sub)
End Sub
I would be grateful for your comments and thoughts please.
Kind regards.
Last edited: