In your variable declarations, change "ManagementQuery" to "ObjectQuery". You cannot declare an instance variable as an abstract class type and then start calling methods and setting properties on it as the abstract class won't have implementations of those properties and methods.
Hi Dave and Richard, thank you for checking my code.
Richard yes that is error I’m getting and thank you trying Dave.
I’m stuck and will have to check Microsoft links tomorrow at work like I said it is my first time and I’m stuck and don’t understand.
Dave since you tried and saw the errors would you be kind to highlight where I’m going wrong so that I can learn from please but if you think it’s better to read the links then I would do that but if I’m not mistaken I got some of the code from Microsoft to understand and I tried but without success.
The image you have posted is not viewable and cannot be downloaded without creating a Mediafire account. Please post the actual code in your original question and explain what the error is and where it occurs.
all the code I copied from microsoft company, even the top of the page I posted without you reading my first questions, now you give the same link from microsoft company. Before you criticize others, have you tried my example ?
If you pass in a host name, the Send method calls Dns.GetHostAddresses[^] and pings the first address returned.
If you want to force it to ping the IPv4 address - assuming there is one - then you'll need to call Dns.GetHostAddresses yourself. You can then find the address you want to ping, and pass that into the Send method instead of the host name.