Click here to Skip to main content
15,901,505 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionArchive or backup Pin
Ebube14-Jul-10 5:15
Ebube14-Jul-10 5:15 
AnswerRe: Archive or backup Pin
Luc Pattyn14-Jul-10 5:17
sitebuilderLuc Pattyn14-Jul-10 5:17 
GeneralRe: Archive or backup [modified] Pin
Ebube14-Jul-10 6:00
Ebube14-Jul-10 6:00 
GeneralRe: Archive or backup Pin
Luc Pattyn14-Jul-10 6:39
sitebuilderLuc Pattyn14-Jul-10 6:39 
AnswerRe: Archive or backup Pin
DaveAuld15-Jul-10 4:10
professionalDaveAuld15-Jul-10 4:10 
Questionhow to use winsock to exchange data in 2 diferent exe Pin
zhiyuan1613-Jul-10 18:39
zhiyuan1613-Jul-10 18:39 
AnswerRe: how to use winsock to exchange data in 2 diferent exe Pin
Eddy Vluggen14-Jul-10 3:07
professionalEddy Vluggen14-Jul-10 3:07 
AnswerRe: how to use winsock to exchange data in 2 diferent exe Pin
Аslam Iqbal14-Jul-10 9:01
professionalАslam Iqbal14-Jul-10 9:01 
Hi,
Following sample shows the use of Winsock in vb6. Just copy, paste & Test.
To Test in local mode (if currently u don't have two machines connected)
Make "yourproject.exe" & run in double instance then:
in 1 instance click Listen(Command2) And another click Connect(Command2).
Then Type text in Text3 and click on Send(Command3).
VB
'Create a new project: Add 3 TextBox, 3 CommandButton And 1 Winsock. Do not change any of them's Name.
'Paste this whole string inside your form's code window
Option Explicit
'Text1= Remote IP/MachineName; for local 127.0.0.1
'Text2= Port Number; I used 1971; you should be sure that the given port is not in use

'Command1=Connect
Private Sub Command1_Click()
Winsock1.Connect Me.Text1, Me.Text2
End Sub

'Command2=Start Listening
Private Sub Command2_Click()
Winsock1.LocalPort = Me.Text2
Winsock1.Listen
End Sub

'Command3=Send Text
Private Sub Command3_Click()
'Text3= what you want to send
    Winsock1.SendData Me.Text3.Text
    'Me.Caption is used to display status
  Me.Caption = "Local Send" & Me.Text3.Text
End Sub

'Received text
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
 Dim AD As String
 Winsock1.GetData AD
 Me.Caption = "Remote: " & AD
 End Sub

'ConnectionRequest
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
    On Error Resume Next ' Just in case there's an error, continue with next command.
     Winsock1.Close ' Close any open socket (just in case).
     'Must accept the request to continue
    Winsock1.Accept requestID
 Me.Caption = "Request accepted"
 End Sub
 
'Chat session closed
Private Sub Winsock1_Close()
Me.Caption = "Closed"
End Sub

'Connected
Private Sub Winsock1_Connect()
 Me.Caption = "Chat Started at " & Time
End Sub

Questioncolumntype checkbox does not chech Pin
Ebube13-Jul-10 5:42
Ebube13-Jul-10 5:42 
AnswerRe: columntype checkbox does not chech Pin
Scubapro14-Jul-10 0:55
Scubapro14-Jul-10 0:55 
GeneralRe: columntype checkbox does not chech Pin
Ebube14-Jul-10 4:43
Ebube14-Jul-10 4:43 
QuestionRTF IMAGE INSERTION Pin
djdrew12-Jul-10 5:35
djdrew12-Jul-10 5:35 
AnswerRe: RTF IMAGE INSERTION Pin
Dalek Dave13-Jul-10 4:14
professionalDalek Dave13-Jul-10 4:14 
AnswerRe: RTF IMAGE INSERTION Pin
The Man from U.N.C.L.E.13-Jul-10 6:54
The Man from U.N.C.L.E.13-Jul-10 6:54 
GeneralRe: RTF IMAGE INSERTION Pin
djdrew15-Jul-10 5:23
djdrew15-Jul-10 5:23 
Questionclick one treenode but it didn't response ,why Pin
sanyexian12-Jul-10 3:18
sanyexian12-Jul-10 3:18 
AnswerRe: click one treenode but it didn't response ,why Pin
Simon_Whale12-Jul-10 3:26
Simon_Whale12-Jul-10 3:26 
GeneralRe: click one treenode but it didn't response ,why Pin
sanyexian12-Jul-10 4:34
sanyexian12-Jul-10 4:34 
GeneralRe: click one treenode but it didn't response ,why Pin
Simon_Whale12-Jul-10 4:41
Simon_Whale12-Jul-10 4:41 
GeneralRe: click one treenode but it didn't response ,why Pin
sanyexian12-Jul-10 5:06
sanyexian12-Jul-10 5:06 
AnswerRe: click one treenode but it didn't response ,why Pin
Аslam Iqbal12-Jul-10 11:54
professionalАslam Iqbal12-Jul-10 11:54 
GeneralRe: click one treenode but it didn't response ,why Pin
sanyexian12-Jul-10 20:50
sanyexian12-Jul-10 20:50 
QuestionCopy data from one excel file to another excel file Pin
priyaahh12-Jul-10 0:49
priyaahh12-Jul-10 0:49 
AnswerRe: Copy data from one excel file to another excel file Pin
Syed Wayez Ahmed12-Jul-10 2:49
Syed Wayez Ahmed12-Jul-10 2:49 
GeneralRe: Copy data from one excel file to another excel file Pin
Syed Wayez Ahmed12-Jul-10 3:13
Syed Wayez Ahmed12-Jul-10 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.