473,765 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB Data Computer.Networ k.PING DO WHILE loop

17 New Member
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
Mar 25 '08 #1
5 2322
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.
Mar 25 '08 #2
SyGC
17 New Member
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
Mar 25 '08 #3
SyGC
17 New Member
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"

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. IpResListBox1.Items.IsReadOnly = resultip  
  3.  
Above this throws the error 'IsReadonly'

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. Pingable_Results_IP_TextBox1.Text = resultip
  3.  
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
Mar 29 '08 #4
balabaster
797 Recognized Expert Contributor
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"

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. IpResListBox1.Items.IsReadOnly = resultip 
  3.  
Above this throws the error 'IsReadonly'

Expand|Select|Wrap|Line Numbers
  1. Dim resultip As String
  2. Pingable_Results_IP_TextBox1.Text = resultip
  3.  
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:
Expand|Select|Wrap|Line Numbers
  1. Dim MyStrings() As String = New String() {"Line1", "Line2", "Line3", "Line4"}
  2. 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
Expand|Select|Wrap|Line Numbers
  1. Dim MyList As List(Of Item)
  2. ListBox1.Items = MyList
won't work...and will result in your readonly error.
However:
Expand|Select|Wrap|Line Numbers
  1. For Each sItem As String in MyList
  2.   ListBox1.Items.Add oItem
  3. Next
will work just fine.
Mar 30 '08 #5
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.
Mar 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1438
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?
1
1813
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...
38
3000
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.
5
6587
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
6
2688
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...
10
2465
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()...
3
11874
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"
25
3013
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
1
2566
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
0
9568
marktang
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...
0
9398
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,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.