Computer name
-
Use
Dns.GetHostEntry
to retrieve anIPHostEntry
, and get theHostName
from this.I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
Ankurm/ wrote:
System.Environment.MachineName
Simple way of getting MachineName you should focus on question which is about get Computer Name based on Ip Address and Pete O'Hanlon answered better and noting can be better than. :omg:
-
Ankurm/ wrote:
System.Environment.MachineName
Simple way of getting MachineName you should focus on question which is about get Computer Name based on Ip Address and Pete O'Hanlon answered better and noting can be better than. :omg:
Code to get IP address and then host name from that IP Address rather than getting the host name directly doesn't make much sense to me. I don't know why I feel that the user wants to ask if he can get the computer name from IP address available to him, which is not possible until he has an "IP Address - Host Name" mapping records available with him. I may be wrong though.
..Go Green..
-
Code to get IP address and then host name from that IP Address rather than getting the host name directly doesn't make much sense to me. I don't know why I feel that the user wants to ask if he can get the computer name from IP address available to him, which is not possible until he has an "IP Address - Host Name" mapping records available with him. I may be wrong though.
..Go Green..
If the question doesn't make sense to you, don't provide an answer. The question that was asked was clear, concise and specific. I wish all questions were like this one. Your comment above is valid, however, and I agree with you somewhat, but perhaps he is doing some log file post resolution of the host name and the log file only holds IPs.(for example only). You should have provided this information with your initial answer and people probably wouldn't have voted you down.
I wasn't, now I am, then I won't be anymore.
-
If the question doesn't make sense to you, don't provide an answer. The question that was asked was clear, concise and specific. I wish all questions were like this one. Your comment above is valid, however, and I agree with you somewhat, but perhaps he is doing some log file post resolution of the host name and the log file only holds IPs.(for example only). You should have provided this information with your initial answer and people probably wouldn't have voted you down.
I wasn't, now I am, then I won't be anymore.
PogoboyKramer wrote:
If the question doesn't make sense to you, don't provide an answer.
Read the comments again. I never said the question doesn't make sense to me. I was rather supporting my answer with the comment.
PogoboyKramer wrote:
but perhaps he is doing some log file post resolution of the host name and the log file only holds IPs.(for example only).
You mean you have a log file which contains IP address only and you want to get the host name from IP addresses. How do you think that would be possible. Again, my previous comment answers this question.
PogoboyKramer wrote:
You should have provided this information with your initial answer and people probably wouldn't have voted you down.
I do agree to this and am sorry about it.
..Go Green..
-
PogoboyKramer wrote:
If the question doesn't make sense to you, don't provide an answer.
Read the comments again. I never said the question doesn't make sense to me. I was rather supporting my answer with the comment.
PogoboyKramer wrote:
but perhaps he is doing some log file post resolution of the host name and the log file only holds IPs.(for example only).
You mean you have a log file which contains IP address only and you want to get the host name from IP addresses. How do you think that would be possible. Again, my previous comment answers this question.
PogoboyKramer wrote:
You should have provided this information with your initial answer and people probably wouldn't have voted you down.
I do agree to this and am sorry about it.
..Go Green..
Thanks for the response. (I didn't mean to sound priskish, BTW) The IP resolution from log file is something I did a couple years back, but for the life of me, I can't remember how. Maybe I'm just blocking out the bad memories. Have a five for this one.
I wasn't, now I am, then I won't be anymore.
-
Thanks for the response. (I didn't mean to sound priskish, BTW) The IP resolution from log file is something I did a couple years back, but for the life of me, I can't remember how. Maybe I'm just blocking out the bad memories. Have a five for this one.
I wasn't, now I am, then I won't be anymore.