elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  mandar ping desde vb
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: mandar ping desde vb  (Leído 4,606 veces)
_CrisiS_

Desconectado Desconectado

Mensajes: 286


Ver Perfil
mandar ping desde vb
« en: 15 Enero 2011, 22:33 pm »

Como podria hacer que al dar clic en un boton se mande un ping  a un IP

si ay conexion se muestre el Messagebox "OK" si no , "FALLO DE CONEXION


En línea

raul338


Desconectado Desconectado

Mensajes: 2.633


La sonrisa es la mejor forma de afrontar las cosas


Ver Perfil WWW
Re: mandar ping desde vb
« Respuesta #1 en: 16 Enero 2011, 00:38 am »

Busca sobre paquetes ICMP


En línea

.::IT::.

Desconectado Desconectado

Mensajes: 167



Ver Perfil
Re: mandar ping desde vb
« Respuesta #2 en: 16 Enero 2011, 17:37 pm »

Pues clases nativas no encontre!!!!!!! pero si te sirve aqui las fuentes del ping pero en C.

http://www.ping127001.com/pingpage/ping.text
En línea

Simplemente .::IT::.
WHK
Moderador Global
***
Desconectado Desconectado

Mensajes: 6.589


Sin conocimiento no hay espíritu


Ver Perfil WWW
Re: mandar ping desde vb
« Respuesta #3 en: 16 Enero 2011, 17:54 pm »

Mira esto, haz un pipe:



Código
  1. Public Class Form1
  2.  
  3.    Private Results As String
  4.    Private Delegate Sub delUpdate()
  5.    Private Finished As New delUpdate(AddressOf UpdateText)
  6.    Dim button_click As Integer = 0
  7.    Dim myprocess As New Process
  8.    Dim StartInfo As New System.Diagnostics.ProcessStartInfo
  9.  
  10.    Private Sub UpdateText()
  11.        ' txtResults.Text = Results
  12.        txtCommand.Clear()
  13.        txtResults.AppendText(System.Environment.NewLine() & Results)
  14.        txtResults.ScrollToCaret()
  15.    End Sub
  16.  
  17.    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  18.        If button_click = 0 Then
  19.            opencmd()
  20.            button_click += 1
  21.        End If
  22.        Dim CMDThread As New Threading.Thread(AddressOf CMDAutomate)
  23.        CMDThread.Start()
  24.    End Sub
  25.  
  26.    Private Sub opencmd()
  27.        StartInfo.FileName = "cmd" 'starts cmd window
  28.        StartInfo.RedirectStandardInput = True
  29.        StartInfo.RedirectStandardOutput = True
  30.        StartInfo.UseShellExecute = False 'required to redirect
  31.        StartInfo.CreateNoWindow = True 'creates no cmd window
  32.        myprocess.StartInfo = StartInfo
  33.        myprocess.Start()
  34.    End Sub
  35.  
  36.    Private Sub CMDAutomate()
  37.        'Dim SR As System.IO.StreamReader = myprocess.StandardOutput
  38.        'Dim SW As System.IO.StreamWriter = myprocess.StandardInput
  39.        myprocess.StandardInput.WriteLine(txtCommand.Text) 'the command you wish to run.....
  40.        myprocess.StandardInput.WriteLine(System.Environment.NewLine())
  41.  
  42.        ' SW.WriteLine("exit") 'exits command prompt window
  43.        While myprocess.StandardOutput.EndOfStream = False
  44.            Results = myprocess.StandardOutput.ReadLine()
  45.            Invoke(Finished)
  46.        End While
  47.  
  48.        'Results = SR.ReadToEnd 'returns results of the command window
  49.        'SW.Close()
  50.        'SR.Close()
  51.        'invokes Finished delegate, which updates textbox with the results text
  52.    End Sub
  53.  
  54.    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  55.        opencmd()
  56.    End Sub
  57.  
  58.    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  59.        Application.ExitThread()
  60.        Application.Exit()
  61.        End
  62.    End Sub
  63. End Class
En línea

[D4N93R]
Wiki

Desconectado Desconectado

Mensajes: 1.646


My software never has bugs. Its just features!


Ver Perfil WWW
Re: mandar ping desde vb
« Respuesta #4 en: 16 Enero 2011, 23:36 pm »

http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx

:)
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Mandar msj de texto a celulares desde pc
Programación Visual Basic
kakinets 9 2,857 Último mensaje 22 Julio 2006, 14:29 pm
por einfluss
No da respuesta el ping desde linux a windows
Redes
hubble 4 14,248 Último mensaje 31 Diciembre 2011, 02:45 am
por megustadormir
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines