Recently I’ve been trying to pay a debt of sorts. I use the software provided on the fantastic XDA-Developers frequently on my Windows Mobile devices and have been doing for almost three years now.
So currently, if I have a little bit of free time, I’ll nip past their development section and try and fulfil a random request.
Today’s request might come in useful to a little bit of a wider audience so I’ll post it here. The initial problem is outlined in this thread and the upshot was that someone needed a very simple Http server that could run on Windows Mobile, written in C#’, and was programmable.
What the guy really seemed to be looking for was something that used the Http protocol to return random computed data, so after a tiny bit of googling and a simple MSDN example, I’ve built a really simple web server for Windows Mobile.
Amusingly, my sample doesn’t behave much like a web server at all. It just tells you what you requested, but it should be enough to get you going in the right direction. It’s derived from the MSDN example with some additional sugar, and I certainly wouldn’t suggest that it’s got a threading model that’d stand up in a production environment (at a glance it looks like it’d process requests in sequence…) but hopefully it’s useful to somebody looking to produce a simple server, or who is just interested in how Http works.
I’m not really sure if I can accurately call it a webserver, seeing as it doesn’t even support a full set of Http Verbs, but you get the idea.
I’ve not actually bothered compiling this on a mobile device yet (lack of inclination) however seeing as it was explicitly based on a socket programming for Windows Mobile MSDN example, I suspect it’ll work just fine. No warranty, do what you will with it.
Download Simple C# Http Server for Windows Mobile (Source Code Only) (7kb)
Ever wanted to generate a change log from all your (dubious) Subversion repository comments? For some reason want to do it in C# or just by calling an exe? Now you can! You can even tie it in to continuous integration!
About 6 months ago I spent an evening porting the Subversion Change Log generator to C# in order to integrate Change Log generation it into our Cruise Control.Net nightly builds at work.
It’s not a direct port, more a C# reimplementation, but it produces the same output as svn2cl (which in itself was inspired by cvs2cl). The gist is, that it calls svn.exe on the command line and retrieves the full history of comments for whichever svn path you request.
It’s not the most elegant thing I’ve ever written (it pretty much just spawns the svn.exe and pipes the output through an XSL transform) and requires you having a command line svn.exe on your system (which if you use subversion on windows is pretty likely), but if you do you should be able to generate change logs from your repositories by calling the compiled executable like so:
SubversionReportProducer.exe –style=ChangeLog.xsl –outputLocation=out.txt –repositoryPath=svn://repo/trunk
If you don’t want to pass the subversion exe path and repository path through on each execution you can specify them by modifying the values in SubversionReportProducer.exe.config. Those values will always attempt to load from configuration, and then attempt to load from a command line parameter (overwriting any app.config settings) allowing for maximum flexibility in batch scripts and automation.
I’ve bundled it with a couple of XSL transform files to produce some output, mostly taken from svn2cl and one subtle adaption that we use in our build process (ingeniously named changelog.xsl).
Your mileage by vary, but this could well be of use to someone.
Source code provided, feel free to contact me about any bugs but I’m pretty much just kicking this out into the wild..
Download Source
Download Compiled Executable
Requires .Net 2.0+