In a .NET Windows service (C#), how can I get the computer name?
Is this a reliable method, or should I wrap it in a try/catch?
Look at the Environment class. There're lots of nice things in there, including the MachineName:
string CurrentMachineName = Environment.MachineName;
According to the docs, this could generate an InvalidOperationException so you'll need to be aware of that possibility. The risk probably doesn't warrant wrapping it in a try/catch, though.