by Bogdan Varlamov (a.k.a. Phantom Stranger)
One of the great things about .NET 3.5 is that it is fully inter-operable with .NET 2.0. You just have to reference the right assemblies and you can use WPF and Windows Forms from the same application! This is great for slowly migrating a .NET 2.0 application over to .NET 3.5; all you have to do is add the new functionality while keeping your old .NET 2.0 logic. Once you are ready, you can slowly migrate your old code over into .NET 3.5 as needed.
Well...at least it's all that easy in theory; there's just one pesky little hiccup--a System.ExecutionEngineException...
Would you like to know more?
by Bogdan Varlamov (a.k.a. Phantom Stranger)
I've been doing a lot of work with .NET Sockets lately, and I will be posting more articles discussing what I've been working on in greater detail. In this article, I want to talk about the concept of reading a Socket asynchronously, raising events to notify your application when bytes are received, and minimizing the number of times the callback method is processed.
If you are familiar with .NET Sockets you might already know that there are asynchronous methods to receive bytes from Sockets (Microsoft has an Asynchronous Server Socket Example available if you are interested in seeing code for doing this).
In the above code sample, a StateObject class that contains a byte buffer with a static size is passed around. When the asynchronous socket read happens, incoming bytes are stored into this buffer and then passed back to the receive callback method. This example works fine, but I think there are some optimizations that can be applied.
Would you like to know more?
So, I've been hoping to make a nice little generic encryption module that essentially just wraps the .Net System stuff. Why? 'Cause I'd like to move some data around with reasonable security (it doesn't have to be completely hacker-proof, just reasonably obscured -- the data I'm covering isn't worth that much, but it's worth more than zero so it deserves some due process.) This is done with that atitude, if you want hard-core encryption, then your better off not using a wrapper (set your .IV cleverly, don't resize improper-length keys, etc.) Alternatively, use an existing, clean, third party app (or write your own -- R4 is not too terrible to code and is very powerful, especially if you tweak it during the implementation).
Would you like to know more?