By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,771 Members | 1,448 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,771 IT Pros & Developers. It's quick & easy.

using native C code in a C# application

P: n/a
Hi,
Our team is working on a network monitoring tool. We have identified
"WINPCAP" as the library that provides support for packet capturing.
WINPCAP is made for WIN32 applications and is coded in 'C' language. We
intend to use this library on C# platform. If anyone has an idea or
experience(.. using native C code in a C# application), then please
help.

Warm Regards

Apr 2 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Assuming you have exported your functions from WINPCAP.dll, you can make
the calls using the P/Invoke layer.

For a good starting point, check out the section of the .NET framework
documentation titled "Consuming Unmanaged DLL Functions", located at (watch
for line wrap):

http://msdn2.microsoft.com/en-us/lib...dc(VS.80).aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ma************@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
Hi,
Our team is working on a network monitoring tool. We have identified
"WINPCAP" as the library that provides support for packet capturing.
WINPCAP is made for WIN32 applications and is coded in 'C' language. We
intend to use this library on C# platform. If anyone has an idea or
experience(.. using native C code in a C# application), then please
help.

Warm Regards

Apr 2 '06 #2

P: n/a
Manu,
If you search on codeproject.com, I remember seeing at least one "Feature
complete" implementation of a managed code C# wrapper for WinPCap. Could save
you a lot of time.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ma************@gmail.com" wrote:
Hi,
Our team is working on a network monitoring tool. We have identified
"WINPCAP" as the library that provides support for packet capturing.
WINPCAP is made for WIN32 applications and is coded in 'C' language. We
intend to use this library on C# platform. If anyone has an idea or
experience(.. using native C code in a C# application), then please
help.

Warm Regards

Apr 2 '06 #3

P: n/a
Various discussions on the topic:

http://www.google.com/search?q=winpcap+C%23

--
Adam Clauss
<ma************@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
Hi,
Our team is working on a network monitoring tool. We have identified
"WINPCAP" as the library that provides support for packet capturing.
WINPCAP is made for WIN32 applications and is coded in 'C' language. We
intend to use this library on C# platform. If anyone has an idea or
experience(.. using native C code in a C# application), then please
help.

Warm Regards

Apr 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.