Visual Basic


  Reply to this topicStart new topicStart Poll

Enviar Paketes a Un Servidor, Una Ayudita Para Mi xD

  Posted: August 12, 2009 05:54 pm  
Quote Post



Iniciad@
*
Member No.: 104
Joined: August 12, 2009
Group: Members
Posts: 1




Bueno Gente Estube Viendo La --- Por Unos Dias Me Gusto Vastante

Bueno Yo Tengo Un Codigo Como Este


QUOTE
Option Explicit
Private Declare Function GetFileTitle _
    Lib "comdlg32.dll" _
    Alias "GetFileTitleA" ( _
        ByVal lpszFile As String, _
        ByVal lpszTitle As String, _
        ByVal cbBuf As Integer) As Integer
     
Private Sub Command1_Click()
    On Error Resume Next
    Winsock1.Conne ct Text1, Text2
    Command1.Enabl ed = False
End Sub

Private Sub Command2_Click()

    Dim sFileName As String
    'Comprobamos que hay un archivo a enviar
    If Trim(Text3) = "" Then
        MsgBox "Debe elegir un pakete"
        Exit Sub
    End If

    If Dir(Text3) <> "" Then
        sFileName = GetFileName(Text3)
        Winsock1.SendD ata "|Pakete|" & FileLen(Text3) & "|" & sFileName
    Else
        MsgBox "El Pakete No Existe"
    End If
 
End Sub

Private Sub Command3_Click()
    With CommonDialog1
        .FileName = vbNullString
        .ShowOpen
        If .FileName <> "" Then
          Text3 = .FileName
        End If
    End With
End Sub

Private Sub Form_Load()
    Text1 = "IP Del Server"
    Text2 = "PuertoDelServe r"
    Text3.Enabled = False
    Command1.Capti on = "Conectar"
    Command2.Capti on = "Enviar"
    Command3.Capti on = " ..."
    Me.Caption = "Cliente"
End Sub

Private Sub Winsock1_Close()
 
    On Error Resume Next

    Command1.Enabl ed = True
    Command2.Enabl ed = False
 
    Winsock1.Close

    MsgBox "La Conexion se ha cerradado", vbInformation
End Sub

Private Sub Winsock1_Conne ct()
    Command1.Enabl ed = False
    Command2.Enabl ed = True

    MsgBox "Conectado correctamente al servidor"
End Sub

Private Sub Winsock1_DataA rrival(ByVal bytesTotal As Long)
    Dim sData As String
    Winsock1.GetDa ta sData, vbString
 
    If sData = "|Ok|" Then Call Enviar_Pakete
End Sub

Private Sub Winsock1_Error( _
    ByVal Number As Integer, _
    Description As String, _
    ByVal Scode As Long, _
    ByVal Source As String, _
    ByVal HelpFile As String, _
    ByVal HelpContext As Long, _
    CancelDisplay As Boolean)
 
    On Error Resume Next

    Command1.Enabl ed = True
    Command2.Enabl ed = False
    Winsock1.Close
    MsgBox "Error al cerrar la conexion"
End Sub

Private Sub Enviar_Archivo()
    Dim Size As Long
    Dim arrData() As Byte
    Open Text3 For Binary Access Read As #1
    Size = LOF(1)
    ReDim arrData(Size - 1)
    Get #1, , arrData
    Close
    Winsock1.SendD ata "C1 04 37 BF"

End Sub

Private Function GetFileName(sPath As String)
    Dim sBuffer    As String * 255
    Dim sTemp      As String
 
    GetFileTitle sPath, sBuffer, Len(sBuffer)
    GetFileName = Left(sBuffer, InStr(1, sBuffer, Chr(0)) - 1)
End Function


Bien Lo Que Quiero Hacer Es Que Se Conecte El Pakete
QUOTE
    Winsock1.SendD ata "C1 04 37 BF"
Con l2.exe y Quiero 3 Textbox Yo Pueda Poner El IP, Puerto y Pakete a Enviar a l2.exe Si Alguien Me Podria Ayudar Se Lo Agradeseria Mucho
 
PMEmail Poster
Top

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


<xmp> <br /> </td> </tr> </table> <br /> </div> <style type="text/css"> @import url("/footers/11/style.css"); </style> <div class="footer-torn"> </div> <div class="footer-container"> <div class="footer-wrap"> <div class="footer-f"></div> <div class="footer-content"> <div class="r1c1"> Get your own forum today! </div> <div class="r1c2"> Signup </div> <div class="r1c3"> Support </div> <div class="r1c4"> Contribute </div> <div class="r2c1"> Adding a Forumer&trade; community to your website is a great way to get return visitors. Create a forum and see how a loyal community of users will propel your site/product/business to a new level. It takes 15 seconds to get started! </div> <div class="r2c2"> <div class="footlink"><a href="http://www.forumer.com/">Forumer phpBB3</a></div> <div class="footlink"><a href="http://www.forumer.com/">Forumer phpBB2</a></div> <div class="footlink"><a href="http://www.forumer.com/">Forumer IPB</a></div> </div> <div class="r2c3"> <div class="footlink"><a href="http://fhq.forumer.com/">Support</a> | <a href="http://kb.forumer.com/">KB</a></div> <div class="footlink"><a href="http://www.forumer.com/terms.php">Terms of Use</a></div> <div class="footlink"><a href="http://www.forumer.com/contact.php?abuse=http%3A%2F%2Fcodigosvisualbasic.com.ar%2Findex.php%3Fshowtopic%3D214%26st%3D0%26">Report Abuse</a></div> <div class="footlink"><a href="http://www.forumer.com/privacy.php">Privacy Policy</a></div> <div class="footlink"><a href="/a/enviar-paketes-a-un-servidor_post214.html">Arch</a> | s30</div> </div> <div class="r2c4"> <div class="footlink"><a title="" href="http://www.trialpay.com/stores/forumer/adremoval30000?tid=6rGU5Yo&sid=visualbasic6">fContribute</a></div> <div id="piggy" class="piggy"><a class="piggy" href="index.php?act=pb"></a></div> </div> </div> </div> </div> <div class="footer-copyright"> Powered by <span class="footlink"><a href="http://www.forumer.com">Forumer</a></span> & <span class="footlink"><a href=" http://www.invisionboard.com " target="_new" rel="nofollow">IPB</a></span> &copy; 2003-2010. All Rights Reserved. </div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-215544-1"); pageTracker._setDomainName("none"); pageTracker._setAllowLinker(true); pageTracker._trackPageview(); } catch(err) {}</script> <script type="text/javascript" src="http://widgets.amung.us/pro.js"></script> <script type="text/javascript" id="wau_scr_66c08eb6"> wau_add('gq1h', '66c08eb6') </script> <noscript> <img src="http://whos.amung.us/piwidget/gq1h/" alt="wau" /> </noscript> </body></html>