Archive for December, 2009

Adding build date/time/count to your C# project

Monday, December 21st, 2009

This is pretty much a straight-forward conversion of http://www.dirty-motherfucker.org/blog/2009/04/24/build-count-of-vc-project-for-version-string/
I was quite pissed that there is no easy option to get something as simple as the build date into your C# project.
So here is my pre-build script I use in my C# projects:

@echo off
SETLOCAL
set TARGET_PATH=%~dp0
set IN_FILENAME="%TARGET_PATH%Version.txt"
set OUT_FILENAME="%TARGET_PATH%Version.cs"
set /p BUILD= < %IN_FILENAME%
set BUILD=%BUILD:~22%
if /I "%BUILD%" == "" [...]

Simulating TCP data from another device

Thursday, December 3rd, 2009

This almost feels too simple to even mention it. But I guess it doesn’t hurt putting it our there. Someone might hit it in a desperate Google hunt.
So this is the deal. You have a device on your network that controls another device by means of sending out simple TCP payloads.
Now you want to perform [...]