问题
Does the Indy ICMP component require Administrator privileges to ping?
If I run with UAC turned on but without elevated privileges I get an "Access Denied" error message.
Looking at this question it sounds like Indy ICMP uses RAW sockets and thus needs elevated privileges?
I'm developing using Delphi 2007 & Indy 10.x and testing under Windows 7 Pro.
回答1:
My colleague found this Article states that the Indy ICMP component uses RAW Windows sockets, which under Vista or later requires elevated privileges to run under UAC.
I adapted the program to request UAC elevation and it's now pinging okay.
The alternative would be to call the ICMPSendEcho() and it's related functions directly.
来源:https://stackoverflow.com/questions/13611525/does-indy-ping-require-uac-elevation