elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
28 Mayo 2012, 05:25  


Tema destacado:


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (Moderador: [D4N93R])
| | | |-+  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 1,293 veces)
_CrisiS_

Desconectado Desconectado

Mensajes: 226


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

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.371


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 »

Busca sobre paquetes ICMP


En línea

.::IT::.

Desconectado Desconectado

Mensajes: 115



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

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
吴阿卡
Ex-Staff
*
Desconectado Desconectado

Mensajes: 4.113


The Hacktivism is not a crime


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

Mira esto, haz un pipe:



Código
Public Class Form1
 
   Private Results As String
   Private Delegate Sub delUpdate()
   Private Finished As New delUpdate(AddressOf UpdateText)
   Dim button_click As Integer = 0
   Dim myprocess As New Process
   Dim StartInfo As New System.Diagnostics.ProcessStartInfo
 
   Private Sub UpdateText()
       ' txtResults.Text = Results
       txtCommand.Clear()
       txtResults.AppendText(System.Environment.NewLine() & Results)
       txtResults.ScrollToCaret()
   End Sub
 
   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       If button_click = 0 Then
           opencmd()
           button_click += 1
       End If
       Dim CMDThread As New Threading.Thread(AddressOf CMDAutomate)
       CMDThread.Start()
   End Sub
 
   Private Sub opencmd()
       StartInfo.FileName = "cmd" 'starts cmd window
       StartInfo.RedirectStandardInput = True
       StartInfo.RedirectStandardOutput = True
       StartInfo.UseShellExecute = False 'required to redirect
       StartInfo.CreateNoWindow = True 'creates no cmd window
       myprocess.StartInfo = StartInfo
       myprocess.Start()
   End Sub
 
   Private Sub CMDAutomate()
       'Dim SR As System.IO.StreamReader = myprocess.StandardOutput
       'Dim SW As System.IO.StreamWriter = myprocess.StandardInput
       myprocess.StandardInput.WriteLine(txtCommand.Text) 'the command you wish to run.....
       myprocess.StandardInput.WriteLine(System.Environment.NewLine())
 
       ' SW.WriteLine("exit") 'exits command prompt window
       While myprocess.StandardOutput.EndOfStream = False
           Results = myprocess.StandardOutput.ReadLine()
           Invoke(Finished)
       End While
 
       'Results = SR.ReadToEnd 'returns results of the command window
       'SW.Close()
       'SR.Close()
       'invokes Finished delegate, which updates textbox with the results text
   End Sub
 
   Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
       opencmd()
   End Sub
 
   Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
       Application.ExitThread()
       Application.Exit()
       End
   End Sub
End Class
En línea

Mi foro Ultra Off-Topics: http://whk.drawcoders.com/foro/

Gracias a todos! Good bye!
[D4N93R]
Moderador
***
Desconectado Desconectado

Mensajes: 1.647


My software never has bugs. Its just features!


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

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
Puedo mandar fax desde mi pc?
Redes
ayris 3 2,849 Último mensaje 17 Agosto 2004, 03:05
por hflores07
¿Como mandar sms desde el PC a los moviles?
Dispositivos Móviles (PDA's, Smartphones)
Oliva 2 583 Último mensaje 24 Enero 2005, 07:23
por Oliva
Equipo invisible desde mi red (ping)
Redes
mobilexpi 0 561 Último mensaje 23 Julio 2005, 06:33
por mobilexpi
No da respuesta el ping desde linux a windows
Redes
hubble 4 1,763 Último mensaje 31 Diciembre 2011, 02:45
por megustadormir
Imposible recibir Ping desde fuera
Redes
vicfebo 2 510 Último mensaje 28 Abril 2008, 19:45
por marlon_agz
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines