|
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.
|
|
|
|
|
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!
Cheers!
Ankur
..Go Green..
|
|
|
|
|
Hello Experts,
I have an Image in which have Some text.
I want to write program for find the text from image.
So if you have any suggetion please help.
Thanks
If you can think then I Can.
|
|
|
|
|
Go through the below link this may helps you
Neural Network OCR[^]
Rajesh B --> A Simple Programmer <--
|
|
|
|
|
Are you talking about OCR? or are you talking about extracting text hidden inside image files?
|
|
|
|
|
No sir,
I have an Image in which have some information in visible form. And i want to get it as a String Format.
Thanks for reply
If you can think then I Can.
|
|
|
|
|
Use OCR, MODI or Atalasoft
|
|
|
|
|
i have a array called rArray and it consist of a list of integers.
how do i compare it to find which one is the smallest or the biggest, assigning smallest to a textbox and biggest to a textbox.
for (int y = 0; y < listBox6.Items.Count; y++)
{
if (rArray[y] < r)
{
}
r is an integer.
modified on Tuesday, November 9, 2010 10:33 PM
|
|
|
|
|
This is the umptieth day you are trying to get either the min and max, or the average (not sure which), of a collection of numbers, which is very elementary. Rather than asking basic questions in a random order, I would strongly recommend you buy and study an introductory book on C#; that will teach you the basics of the language, of programming in general, and of Windows programming in particular. In one week's time you could acquire a lot of knowledge, well structured, explained and illustrated, and by doing so raise yourself to a whole different level.
If you don't want to do that, I can only suggest you choose and read some of the excellent articles here on CodeProject (stick to the ones that have a score of at least 4 out of 5), as you are in need of coding examples.
|
|
|
|
|
This[^] article discusses sort (using LINQ) on string arrays - but the concepts for integers is fairly similar.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
LINQ also has functions for Max and Min so it can be as simple as...
int[] nums = new int[]{1, 2, 3};
textBoxMax.Text = nums.Max().ToString();
textBoxMin.Text = nums.Min().ToString();
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
What do you think you should do? This is a fairly basic comparison problem, and you should be able to work it out by just writing out the steps that you would do to perform the same task. Break the problem down into smaller and smaller steps and then you will reach your solution.
|
|
|
|
|
Based on your question I would assume this is some kind of homework assignment so you should definitely use my other post suggestion for LINQ and not explain your method in any shape, way or form.... then your lesson is learned
The reason why this must be a homework assignment is because it is so basic. If you where trying to do this for any other reason (like a career in programming) then you should have more of an interest, which would mean you would have already gone down the route Luc had suggested (which is certainly the way forward) and would not be posting this question ANYWHERE.
The other option is that the potential money for a career in programming is your motivation but unfortunately with great programming career comes great need for ability to think
...maybe I am being too harsh...
int min = nums[0];
int max = nums[0];
foreach(int i in nums){
if(i < min)
min = i;
if(i > max)
max = i;
}
...now the challenge: can you work out how to create nums?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: ...now the challenge: can you work out how to create nums?
That's easy. You post a follow up question "Urgntz. How to create nums."
|
|
|
|
|
Guys,
I am very naive in Programming, I have a .exe file with me, now i want to build a setup component and install in system, how to update the .exe file in Control panel(Add or Remove compnent). And the same when i want to unistall back from control panel items, what are the thing that i need to do... can some body help me out.. Please..
Thanks in Advance
|
|
|
|
|
Please do NOT ask the same question in more than one place. It doesn't get any better answers, and it annoys people who might have helped you.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Hi,
What would be the fastest way to ping 255 IP addresses?
Are there any example with using multithreading, as I am quite new to threading.
|
|
|
|
|
The multi-threading itself isn't problematic; getting it all done in a reasonable time may be a bit of a problem.
I would use say four to eight identical instances of a class that starts a thread which, in a loop:
- fetches an IP address out of a shared queue;
- calls Network.Ping();
- stuffs the result in another shared queue.
Of course, both queues need their lock.
You should not pre-assign IP addresses to threads, as you can't predict how long a ping operation will take; typically those that succeed run fast, and the failing ones have to wait for their time-out. And adding more threads won't help much as I expect you will end up running in network limitations.
|
|
|
|
|
For my application I can set time-out to less then 250ms, so waiting is not a issue.
When using lock, does this mean the first thread that access "variable" locks the access and
if other threads are trying to access same "variable" wait (like thread.sleep) until it is released?
|
|
|
|
|
1.
250msec * 255 IP adr / 8 threads is still 8 seconds.
2.
yes, said locks would be exclusive, but only while accessing the queue, not while pinging (hence only a small fraction of the time). Like so (in pseudo-code!):
lock(IPadrLock) {
IPadr=IPadrQueue.Dequeue();
}
result=ping(IPadr);
lock(resultLock) {
resultQueue.Enqueue(result);
}
|
|
|
|
|
|
It is polite to up vote a helpful answer.
Never underestimate the power of human stupidity
RAH
|
|
|
|