c# program pinging computers and get bluescreen
Ping object is disposable... So use it to release windows resources.
for (int i = 0; i < 255; i++)
{
using (System.Net.NetworkInformation.Ping pingSender = new System.Net.NetworkInformation.Ping())
{
//textbox.text example: 10.20.18.
//i = 0 > 255
targetIP[i] = textBox2.Text + i;
//send ping
PingReply reply = pingSender.Send(targetIP[i], timeout, buffer, options);
//if reply is successfull
if (reply.Status == IPStatus.Success)
{
textBox1.AppendText("Address: " + reply.Address + "\t ms: " + reply.RoundtripTime + "\n");
}
}
Sending ping gets my Windows 8.1 machine to crash
There's no way of fixing this through ammendments to your code, this issue is caused by sending pings during debug. You can use System.Diagnostic.Debugger.IsAttached property to determine if the debugger is attached and disable pinging. Read more here: C# program causes bluescreen?
C# program causes bluescreen?
Just to be clear, there is no way for "user" mode code to forcibly create a blue screen in windows, unless it uses undocumented APIs and or forces bad data into a driver. Your C# code is likely not be at fault here, as if you use the user mode classes (Socket) then the socket is responsible for not crashing your computer.
As @Joe has commented Microsoft Support KB Article 256010 clearly describes this stop message, but better yet has clear instructions on capturing the driver name responsible for this error.
Note that any software firewall that you have installed also is involved at kernel mode level so could also be responsible for this error. I recommend you follow the KB articles advice and try to find out what is at fault. But you could also ensure that you have updated your network drivers and firewall/VPN software to the latest stable versions.
VS2012 Is A BSOD Causer
It's a known issue with Visual Studio (since VS2010, apparently) and the Ping
class.
Posted by Microsoft on 06/02/2012 at 09:11
Thank you for your feedback. This is a known issue with the underlying Windows APIs used by the Ping class. The Windows team is will determine how to best handle the issue.
programmatically trigger BSOD
Killing process "csrss.exe" causes BSOD.
But you need Administrator privileges to do this. I'm not sure there is a way to do this purely with restricted privileges.
EDIT:
Yep, it works alright. I cooked myself a nice little BSOD :)
System.Diagnostics.Process.GetProcessesByName("csrss")[0].Kill();
Related Topics
Check If a Property Exists in a Class
Getting the Index of a Particular Item in Array
Keep Casing When Serializing Dictionaries
Edit Raw Pixel Data of Writeablebitmap
Why Is Parallel.Foreach Much Faster Then Asparallel().Forall() Even Though Msdn Suggests Otherwise
What Are the Naming Conventions in C#
How to Get All Cookies of a Cookiecontainer
Creating an Mvvm Friendly Dialog Strategy
How to Enable Nullable Reference Types Feature of C# 8.0 for the Whole Project
Can Razor Class Library Pack Static Files (Js, CSS etc) Too
Post String to ASP.NET Web API Application - Returns Null
Stack Overflow Exception in C# Setter
JSON.Net: Specify Converter for Dictionary Keys
C#: How to Create an Attribute on a Method Triggering an Event When It Is Invoked