I want to write a port scanner in C# and I can\'t use SocketType.Raw as raw sockets were taken out from desktop versions of windows. I can\'t use SharpPcap either or other w
Try running Visual Studio as Adminitrator
Right click ---> run as administrator
Then execute programs with raW sockets..
Take note on how nmap did it and that for now I believe your option would be to go to a lower level at the ethernet frame.
"Nmap only supports ethernet interfaces (including most 802.11 wireless cards and many VPN clients) for raw packet scans. Unless you use the -sT -Pn options, RAS connections (such as PPP dialups) and certain VPN clients are not supported. This support was dropped when Microsoft removed raw TCP/IP socket support in Windows XP SP2. Now Nmap must send lower-level ethernet frames instead."
So - that brings us to:
http://www.codeproject.com/KB/IP/sendrawpacket.aspx
Just like this:
http://www.winsocketdotnetworkprogramming.com/clientserversocketnetworkcommunication8h.html
Also, at what point was it removed from Windows? I did a chat client for a friend last week; as well, http://msdn.microsoft.com/en-us/library/system.net.sockets.sockettype.aspx , still lists it as being active.