Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - acquiring machine name from inside an object library

Reply
 
Old 11-13-2008   #1 (permalink)
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.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

My System SpecsSystem Spec
Old 11-13-2008   #2 (permalink)
Norman Yuan


 
 

Re: acquiring machine name from inside an object library

Look into System.Environment namespace.

"jason" <iaesun@xxxxxx> wrote in message
news:bb46d53c-f05c-4dee-8d94-adda167e0c94@xxxxxx
Quote:

> 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
My System SpecsSystem Spec
Old 11-13-2008   #3 (permalink)
jason


 
 

Re: acquiring machine name from inside an object library

There it is! Thanks very much, Norman.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
What's inside an object? VB Script
Help "Getting an Object Inside of an Object" PowerShell
Microsoft Speech Object Library compiler warnings .NET General
Lotus domino Object Library PowerShell
Adding canonical aliases for Compare-Object, Measure-Object, New-Object PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46