C# Developers' Journal (original) (raw)

7:28a

I ran across a dilemma in C# that has forced me to not like the .NET TreeView control. Why the hell doesn't a right click on the tree force a node selection and therefore raise the BeforeSelect and AfterSelect event? I've spent about three hours trying to find a work around for this. I can catch the click event (and others such as MouseUp and MouseDown), however when I get tree.SelectedNode in those event handlers, it points to the node that is selected, not the node that I right clicked on. Am I just missing something? I thought something as simple as right clicking on a node and getting it would be a simple task to accomplish in .NET.

7:29p

Outgoing packets Is there any way (besides using winpcap) to capture outgoing packets in Windows XP using C#.NET? I have written a neat socket class that binds to an interface and does a great job at throwing events for every packet received, but I don't see a single packet that's sent.

I have also downloaded several "example" applications from various .NET repositories on the internet that purport to capture outgoing packets, but don't.

I have heard of some issue (that may or may not be imagined) that outgoing packets capture using the stock network socket tools in Windows 2000 but not Windows XP. I don't know why this would be true, or even if it is true, but I do not have any software firewalls running on any of my PCs (I have a Linux machine acting as a combination firewall/router/PPPoE (*shudder*)/DHCP/etc. device, but that's my gateway and has nothing to do with the computers from which I am attempting to capture outgoing packets.

Any help, information, or source code is appreciated.