rebel_
Banned
- Katılım
- 28 Ağu 2006
- Mesajlar
- 88
- Reaction score
- 0
- Puanları
- 0
- Yaş
- 36
'2 tane Command Buton var 1 tane Textbox var
'1 de timer attım oda bağlantı olup olmadığını kontrol ediyor ve
'timer internal 100 olacak
'Bu Terminaller içindir.
Dim i As Long
Dim Con As Long
Private Sub Command1_Click()
Winsock1(0).SendData Text1.Text
End Sub
Private Sub Command2_Click()
Winsock1(0).Close
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
Winsock1(0).Close
End Sub
Private Sub Timer1_Timer()
Select Case Winsock1(0).State
Case 0
Label1.Caption = "Kapalı"
Case 1
Label1.Caption = "Açık"
Case 2
Label1.Caption = "Bağlantı bekleniyor"
Case 7
Label1.Caption = "Bağlı"
Case 9
Label1.Caption = "Hata!"
Case 8
Label1.Caption = "Bağlantı Kesildi"
'bağlantı kesildiğinde tekrar dinlemeye başlamak için
Winsock1(0).Close
Winsock1(0).LocalPort = 1024
End Select
End Sub
Private Sub Form_Load()
i = 0
Con = 0
Winsock1(0).Close
Winsock1(0).Connect "192.168.4.99", 1024 'Bağlanacak Serverın ip si ve port numarası
End Sub
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
i = i + 1
Con = Con + 1
Load Winsock1(i)
Winsock1(i).LocalPort = 0
DoEvents
Winsock1(i).Accept requestID
DoEvents
End If
End Sub
Private Sub Winsock1_Error(Index As Integer, 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)
Winsock1(Index).Close
DoEvents
Con = Con - 1
End Sub
Arkadaşlar Alıntıdır:hhdil
'1 de timer attım oda bağlantı olup olmadığını kontrol ediyor ve
'timer internal 100 olacak
'Bu Terminaller içindir.
Dim i As Long
Dim Con As Long
Private Sub Command1_Click()
Winsock1(0).SendData Text1.Text
End Sub
Private Sub Command2_Click()
Winsock1(0).Close
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
Winsock1(0).Close
End Sub
Private Sub Timer1_Timer()
Select Case Winsock1(0).State
Case 0
Label1.Caption = "Kapalı"
Case 1
Label1.Caption = "Açık"
Case 2
Label1.Caption = "Bağlantı bekleniyor"
Case 7
Label1.Caption = "Bağlı"
Case 9
Label1.Caption = "Hata!"
Case 8
Label1.Caption = "Bağlantı Kesildi"
'bağlantı kesildiğinde tekrar dinlemeye başlamak için
Winsock1(0).Close
Winsock1(0).LocalPort = 1024
End Select
End Sub
Private Sub Form_Load()
i = 0
Con = 0
Winsock1(0).Close
Winsock1(0).Connect "192.168.4.99", 1024 'Bağlanacak Serverın ip si ve port numarası
End Sub
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
i = i + 1
Con = Con + 1
Load Winsock1(i)
Winsock1(i).LocalPort = 0
DoEvents
Winsock1(i).Accept requestID
DoEvents
End If
End Sub
Private Sub Winsock1_Error(Index As Integer, 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)
Winsock1(Index).Close
DoEvents
Con = Con - 1
End Sub
Arkadaşlar Alıntıdır:hhdil