I have multiple machines for each DEV, QA, and Production. I need to implement a solution of finding the host machine's identity with the intent of eventually integrating it into some common library dll.
On some older applications that I have, errors are sometimes generated but it is not clear which machine this is coming from and obviously it becomes an issue when some automatically generated error is created without knowing the environment.
In my current situation I'm only allowed to modify the error message input into the log generator, and not any internals beyond that.
With that given I need some code that returns a
You can use
System.Environment.MachineName to get the current computer's name.
You just need to make sure the machine name provides you with enough information. If it doesn't and you have a Domain, you can probably add some information about each machine in the Active Directory, and fetch it from there.