tags:

views:

1352

answers:

1

Hello, I'm trying to get the ICMP code found here to work. However on this line:

Socket = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork,
                                       System.Net.Sockets.SocketType.Raw,
                                       System.Net.Sockets.ProtocolType.Icmp);

I get SocketException: "An attempt was made to access a socket in a way forbidden by its access permissions" (Native error code: 10013)

Running in administrator mode is one (bad) solution, but since I want my program to work on user level, what would you sugesst? Other ICMP approaches is also welcome.

I have been trying to play around with "ClickOnce" security settings, which didn't help.

+1  A: 

ICMP and raw sockets are restricted to administrator users since Windows 2000. You have not stated what you're trying to do, but you may try the NetworkInformation namespace to achieve your goal: NetworkInformation

It includes a Ping class to send ICMP echo requests.

__grover