Greetings All,
I have established a working Remote Connection to a MySQL DB using ODBC which allows me to select data in a Datagridview in my Form. The data is a list of IP addresses. What i want to do is take each IP address, parse it to My.Computer.Net work.Ping if the result returns false then the IP address is diaplayed in a TextBox1. If the result is true then the IP address is either disgarded or displayed in another TextBox field.
Fairly simple IF ELSE statement which i think needs to be used in conjunction with a DO WHILE loop.
Due to thier being numerous IP addresses to Ping the loop would be placed in a seperate thread and the actual Ping arguements altered accordingly (timeout etc)
I think with this i need some direction is the best way to get started,
Any thoughts?
Thanks in advance as always,
Sy
5 2324 Plater 7,872
Recognized Expert Expert
It seems like you have the right idea. (A seperate thread of sorts would be needed to keep things moving along)
You have the IP addresses.
You have the PING section available to you.
You know what to do for successfull pings and unsuccessfull pings
Just give it a shot and see what comes out.
I might suggest that use a "pool" of some number of threads, and some mechanism to feed them IP addresses as needed. But that is a bit overly complex at this point I thjink.
It seems like you have the right idea. (A seperate thread of sorts would be needed to keep things moving along)
You have the IP addresses.
You have the PING section available to you.
You know what to do for successfull pings and unsuccessfull pings
Just give it a shot and see what comes out.
I might suggest that use a "pool" of some number of threads, and some mechanism to feed them IP addresses as needed. But that is a bit overly complex at this point I thjink.
Hi Plater,
yea im giving it a go as we speak. I think the issue at the moment is extracting the IP Addresses from the Datagridview to parse to the Network.Ping.
Anyway ill crack on! Any suggestions though feel free! :P
Sy
Hi Plater,
yea im giving it a go as we speak. I think the issue at the moment is extracting the IP Addresses from the Datagridview to parse to the Network.Ping.
Anyway ill crack on! Any suggestions though feel free! :P
Sy
Hello All,
Ive been able to extract the IP Addresses from my data set and parse them to an array which in turn parses them to the Network.Ping method running in a WHILE loop in a seprate thread. Ive then pointed the the results from the Network.Ping method (True/False) displaying the IP address if returning False in a textbox field. However all i want to do is simply return line each time an IP address is parsed to a textbox field. Ive looked into using a list box but cannot get the IP addresses to be shown as its "items" -
Dim resultip As String
-
IpResListBox1.Items.IsReadOnly = resultip
-
Above this throws the error 'IsReadonly' -
Dim resultip As String
-
Pingable_Results_IP_TextBox1.Text = resultip
-
Above returns the IP Address meeting the Ping arguement however doesnt return line and instead replaces the first IP Address with the second.
Any Thoughts? (Its so simple i know...ive had a bad week...if not a usual week)
Sy
Hello All,
Ive been able to extract the IP Addresses from my data set and parse them to an array which in turn parses them to the Network.Ping method running in a WHILE loop in a seprate thread. Ive then pointed the the results from the Network.Ping method (True/False) displaying the IP address if returning False in a textbox field. However all i want to do is simply return line each time an IP address is parsed to a textbox field. Ive looked into using a list box but cannot get the IP addresses to be shown as its "items" -
Dim resultip As String
-
IpResListBox1.Items.IsReadOnly = resultip
-
Above this throws the error 'IsReadonly' -
Dim resultip As String
-
Pingable_Results_IP_TextBox1.Text = resultip
-
Above returns the IP Address meeting the Ping arguement however doesnt return line and instead replaces the first IP Address with the second.
Any Thoughts? (Its so simple i know...ive had a bad week...if not a usual week)
Sy
Set your textbox to multiline. The textbox can now be populated as an array of string - check out the example below: - Dim MyStrings() As String = New String() {"Line1", "Line2", "Line3", "Line4"}
-
TextBox1.Lines = MyStrings
The other way is a listbox...you can't just set the listbox to show the items in that fashion.
For instance - Dim MyList As List(Of Item)
-
ListBox1.Items = MyList
won't work...and will result in your readonly error.
However: - For Each sItem As String in MyList
-
ListBox1.Items.Add oItem
-
Next
will work just fine.
Plater 7,872
Recognized Expert Expert
You could use DataGridView and use your DataSet as the DataSource.
Then cycle through your DataTable (instead of pushing them to another array) and just update a 2nd column about if it could ping the address or not.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Paul Wagstaff |
last post by:
Hi there folks,
Within Access 97,
Can anyone tell me the proper way to 'ping' a workstation on a NT 4 network
and/or gather data such as the IP adress. Currently I have code and use
SendKeys, which I know is rubbish...I'd also be grateful if such things as
the FAP of the workstion could be ascetained. In short, what I'm asking is
what is the best way to get a bunch of data about remote workstations?
|
by: Ciro |
last post by:
Hi Guys, I'm developing an application that sends ICMP echo requests (ping)
via the .net Ping Class. I've some informations related to the network such
as IP addresses,Urls,SiteNames and so stored in a xml file. I need to use
theese informations in my ping method. The ping method will ping the sites
and change the background color property of some shapes I've created.
In the first version of the application I created an Arraylist of all the...
|
by: Tom |
last post by:
I need my data generating C program on computer #1 to export small
amounts of data (one - 40 byte data structure) periodically (once per
minute) to a C program on computer #2.
I am considering having computer #1 to create two duplicate data files
sequentially. (file_1.dat & file_2.dat).
Then, Computer #2 tries to open file_2.dat and upon failure it opens
file_1.dat.
|
by: =?Utf-8?B?bWFydGluMQ==?= |
last post by:
Hi, All,
I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?
Thanks in advance,
Martin
|
by: MattPKaiser |
last post by:
I am trying to find a way to check if a computer on a network is
"online" so that I can access a file on a share.
In short I maintain a list of computers that have my service running
(in the client application) and in my client program I allow the user
to change the computer that they are accessing.
If a computer that is on the list becomes unplugged and I try to
access a file with a FileStream the filestream creation takes 8-10...
| |
by: Charlie of Bolton |
last post by:
Hi,
I have to below script,
and everything seems to work except
that if I entered the Primary IP and Secondaries IP, with such
number; 10.100.1.11 or 10.10.10.245 the last numbers of my IP are missing
in my logs file (c:/tmp/myprimarylogs.xls) Here is the result, you see, '10.100.1.1 should be 10.100.1.11
and 10.10.10.2 should be 10.10.10.224 how can I resolve this issue ?
and I need to know How to add the time : time.asctime()...
|
by: SyGC |
last post by:
Hi People,
Im trying to do a simple Loop where by an IP address is pinged (Using My.computer.network.ping) and the results, true or false, are used to invoke another line of code.
Basically if the IP is pingable (true) image A is displayed if it is not (false) then image B is.
The code i am using is as follows
Dim IPAddress As String = "192.168.1.122"
|
by: p byers |
last post by:
Good Morning Folks
I have a LAN
Among the several connections to it are the following four devices:
A MAXSTOR network Storage Device
A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4)
A PC running Microsoft Windows XP Professional 5.1.2600 (SP2)
A PC running Microsoft Windows XP Professional 5.1.2600 (SP2)
All of the PCs are running IIS
|
by: somsub |
last post by:
Can any one help me on ping command .
for this line of code
($ret, $duration, $ip) = $p->ping ($line)
If i give any
1> invalid entry as a parameter ($line) in ping command
or
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |