|
-
Mar 18th, 2008, 01:10 PM
#1
Thread Starter
Member
Ping (System.Net.NetworkInformation) Visual Studio 2005
Hey guys, I am trying to create a new ping program in Visual Studio 2005. And I need alittle help. After doing alittle reading/research I have come up with this.
Imports System.Net.NetworkInformation
'
Public Class frmMain
'
Dim p As Ping
Dim pReply As PingReply
'
Private Sub btnPing_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPing.Click
Try
p = New Ping
pReply = p.Send(txtAddress.Text)
lblStatus.Text = pReply.Status.ToString
Catch pExc As PingException
MessageBox.Show(pExc.InnerException.Message)
End Try
End Sub
This line here "lblStatus.Text = pReply.Status.ToString" What I would like to happen is. If the reply is "Success" <--- then this should display in the color green. If they reply is "Failed" then I would like this color to be red. Any idea's on how I can acomplish this ?
Thanks
ScarEye
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|