Ping forbidden when SocketPermissionAttribute is Unrestricted

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using .NET Framework v1.1 on Win2000 and WinXP

Low Level Users get this error when code does a Ping:
System.Net.Sockets.SocketExecption: An attempt was made to access a socket
in a way forbidden by its access permissions.

Ping is using ICmp protocol via a Raw socket.
Code works fine for high level users.
TCP/IP sockets and remoting work fine for low level user only Ping fails.
Fails even when Firewall is Off.

AssemblyInfo.cs contains:
[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum,
Name="LocalIntranet")]
[assembly: SocketPermissionAttribute(SecurityAction.RequestMinimum,
Unrestricted=true)]
 
An (far better) alternative to this would be an easy quick responsive way to
determine if a computer/device is on the LAN or not in the API, at a level
that would allow programs run by low level users to do these checks without
the very lengthy time outs that are incurred in other parts of the API.
 
Back
Top