-2
我正在C#中進行應用程序。我有代碼如下,我正在運行應用程序作爲管理員。我使用Windows 7 代碼:IOControlCode.ReceiveAll方法中的錯誤
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
socket.Bind(new IPEndPoint(IPAddress.Any, 24097));
socket.ReceiveBufferSize = 2 * 1024 * 1024;
socket.ReceiveTimeout = 500;
byte[] invalue = new byte[4] { 1, 0, 0, 0 };
byte[] outvalue = new byte[4];
int c = socket.IOControl(IOControlCode.ReceiveAll, invalue, outvalue);
Error: An invalid argument was supplied.
爲什麼downvote? Downvoter你能告訴我原因嗎? – Dany 2012-01-10 07:42:11
這個迴應是有道理的,因爲你問錯了,你只是輸入代碼而不是描述,你是問題。沒有人會閱讀代碼來理解你的問題。 – Burimi 2012-01-10 07:51:09
[Packet嗅探器套接字異常]的可能重複(http://stackoverflow.com/questions/4013217/packet-sniffer-socket-exception) – jgauffin 2012-01-10 07:53:59