Playing with C# – Made A Client-Server Remote Monitoring Tool

Well, as usual things have been a little more hectic than I was expecting but I am enjoying most moments of the days past. Work has been really busy as we have been trying to launch our new platform, which I think I had mentioned is a full-fledged Microsoft environment consisting of Commerce Server, CRM, and SharePoint.

Personally, making the jump from PHP to C# has been a bit of… a bag of mixed emotions? At times I love it, hate it, want to kill it, marry it, etc… You get the point. There is quite a learning curve, as there is with any programming language, but my mind seems a bit reluctant to leave PHP behind. I have, however, been forcing myself to learn it; and fast! I have been building some necessary web parts at work that we need to help build microsites on the new platform.

Along with programming with C# at work, I have been spending some of my nights developing proof of concept pieces of software as a hands-on learning experience. So with that; I have successfully built a (simple) Client-Server monitoring tool utilizing Lidgren Networking Library for .NET (to handle my network communication between client and server).

Upon startup the client will send out broadcast messages to find a local server. Once it finds a server to connect to it will send over some basic information, such as username and machine name (for awesome display on the Server or “viewer). After sending that information over, the server will send back a message with the Clients unique session ID for communication purposes. From that point on the client will blast the server with screenshot’s of it’s desktop. Cool, right?

Upon startup the server will listen for any incoming client requests (standard right? =P). Once a client says, “hey, i want to send you screenshot’s of my desktop”, the server will create a new instance of a grouping of a PictureBox and Label within a uniquely named panel (for updates!) which in turn is rendered within a FlowLayoutPanel for some awesomely automagic built-in item arrangement.

This gives you a simple view of the Server or “viewer” and how it displays the screenshots:

Pretty interesting, right? I have sunk some good free time in to working on this but I feel it has been worth it. If nothing else, it is helping me get used to working with C# on a more natural level (as opposed to: derp derp derp, I give up)  and that makes me happy.

If I get some more time I will write about how I did this, at least in its simplest form, because it may help some people who want to learn. I had to do hours and hours of research to figure some of the stupidest things out. Eliminating that waste for others may be a noble thing for me to do.

5 thoughts on “Playing with C# – Made A Client-Server Remote Monitoring Tool”

  1. hi i want to monitor server or my website database or webservice by client or from client .
    is any solution that i dont use timer that every 5min for example check the server ???

  2. dude, quit C#, move on to – it has more features than C# and is much more enjoyable to code with, more readable, more features supported, background compiler etc, and you end up writing less bugs. you will never get the enjoyment you do from a app from any other app (generally speaking). And dont misunderstand the reason why people go for C#, it’s pure marketing, because it has the letter “C” in it, people think they are C/C++ programmers and that does something to their self-image lol.

    also vb6 was terrible compared to, a different language, and same name, give a bad rep. give it a try, everything will flow better once you do.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>