Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Net / Sockets

Net / Sockets Components for network and related use

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-29-2009, 5:05 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: Jun 2009
Age: 22
Posts: 1
Reputation: 0
BlackOne is on a distinguished programming path ahead
Default How to ping

Hi all!

I'm making a program for my wireless network witch is connected on mysql db and read from table "spot" data "name, ip , up, down, status, last_up" then i wonna ping ip every 5 min then insert new data in DB is spot online ofline ,...

name - name of spot
ip - ip adress of spot
up - How long is spot up
down - how long is spot down
status - is spot up or down
last up - whan is spot was last online

I connected with db with this code and show data in datagridview

Code:
    Private Sub refreshStatus(ByRef statusView As DataGridView)
        Dim conn As New MySqlConnection
        Dim myCommand As New MySqlCommand
        Dim myAdapter As New MySqlDataAdapter
        Dim myData As New DataTable
        Dim SQL As String

        SQL = "SELECT naziv, ip, status, up, down, last_up FROM tocke "

        conn.ConnectionString = myConnString

        Try
            conn.Open()
            Try
                myCommand.Connection = conn
                myCommand.CommandText = SQL

                myAdapter.SelectCommand = myCommand
                myAdapter.Fill(myData)


                statusView.DataSource = myData
                dgvStatus.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
            Catch myerror As MySqlException
                MsgBox("There was an error reading from the database: " & myerror.Message)
            End Try
        Catch myerror As MySqlException
            MessageBox.Show("Error connecting to the database: " & myerror.Message)
        Finally
            If conn.State <> ConnectionState.Closed Then conn.Close()
        End Try


    End Sub
now how to make to ping ip of spot i wonna ping with whis code and how to enter new data in table please help!

Code:
If My.Computer.Network.Ping("www.google.com", 1000) Then
  		MsgBox("Server pinged successfully.")
	Else
  		MsgBox("Ping request timed out.")
	End If
when i make this i will easy make in php statistic is hotspot online or ofline how long is online or offline...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 11:31 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.