Get the Ipaddreses of your lan first u can use command "net view" it gives the machine names of all your network , then get the corresponding ipaddress of each machine, then combine ipaddress combination with your port list and ping, if u got answer then u have the correct ipaddress.
i think you misunderstand how IP addresses and ports work
think of a street with 10 buildings, each building has 10 flats and each flat has its own mail box. Now in this example the IP would be the buildings physical address and the port number would be the flat number.
an IP points to a physical machine on a network and a port points to a specific service on that machine.
Harvey Saayman - South Africa
.Net, C#, SQL
No you don't. All you have is the IP of a server with that port open. You may have multiple severs with the same port open. All of your servers may have that port open. You don't know you've got the one you were looking for.
There is no way to resolve a port address to an IP address.
I have a program that tests DB tables. As these tests can take up to several minutes, I want to outsource them into other threads, to at least give the user to possibility to abort them/exit the application.
It's not intended that the user can execute several tests at a time, so I actually only need the main thread in which the Windows Form is running and a single worker thread that performs the test.
My main problem is that I run the test table by table in a loop and each time a table has finished testing, several dictionaries and controls are updated.
When the tests is performed by another thread, it means that the user can access the same dictionaries the testing thread is updating.
So far I just tried to get the testing thread running and allow the user to abort it but I didn't have much success yet.
I used the Windows Forms Invoke Method but that doesn't seem to help much, as the GUI still doesn't respond until the test is finished.
Could you tell me what approach would be best?
Should I use a ParameterizedThreadStart that gets passed a list of all dictionaries?
And how would I go about updating the Windows Forms controls? Create some event that is fired when a table has finished testing?
I've tried it and it seems the BackgroundWorker is indeed a good solution.
It's just a hassle, because during the test the worker thread needs to access a variety of lists and update several controls on the form.
I'm using ArrayLists as arguments to provide data for the worker thread and send the results of it to the form.
It's a bit awkward as I have to cast not only the argument object but also the content, is there any better solution that is more type safe?
Please stop posting the same question. You've asked the same question 3 times in the last 24 hours, and have ignored the replies you already had. I suggest you revisit your earlier[^] questions, rather than opening up new ones.
Deja View - the feeling that you've seen this post before.
I have to put a checkbox in a DateTimePicker. My idea is whenever I check the checkbox the datetimepicker will be activited and will be disabled otherwise. if anybody knows the solution plz help me out. thanks