acquiring machine name from inside an object library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jason

    acquiring machine name from inside an object library

    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.MachineN ame 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
  • Norman Yuan

    #2
    Re: acquiring machine name from inside an object library

    Look into System.Environm ent namespace.

    "jason" <iaesun@yahoo.c omwrote in message
    news:bb46d53c-f05c-4dee-8d94-adda167e0c94@v1 3g2000pro.googl egroups.com...
    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.MachineN ame 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

    Comment

    • jason

      #3
      Re: acquiring machine name from inside an object library

      There it is! Thanks very much, Norman.

      Comment

      Working...