acquiring machine name from inside an object library

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

Hello everyone,

I am writing to discover if there is a way, through System libraries
or some other method, to acquire the name of the local machine from
within an object library DLL.

In case it is relevant, I have an object library DLL that performs a
generic "error handling" process for each exception that is thrown by
either itself, or by an application that is using the DLL. One of the
pieces of information that the generic error handling process expects
is the name of the machine that threw the exception.

I have found that machine name can easily be provided by the consuming
application reporting the exception. For example an ASP.NET website
can use the current HttpContext Server.MachineName property. However,
I'm not sure if there is a similar way to discover the local machine
name to report when the exception happens within the DLL itself, where
it may or may not have access to any of the HttpContext or
configuration settings that any particular subscribing application can
provide.

Thanks for any help,

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top