Kaynak Kod || İlk yazdığım chat programım
Kod:
Imports System.Net, System.IO, System.Web
Public Class Form1
Dim ftp, web As New Net.WebClient
Dim alan As String = "ftp://goldpasta.net/www/bta/"
Dim www As String = "http://www.goldpasta.net/bta/"
Dim değer As String
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal tuş As Long) As Integer
Private Sub gön_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gön.Click
Try
ftp.UploadString(alan & "sohbet.bps", web.DownloadString(www & "sohbet.bps") & ad.Text & " ( " & TimeOfDay & " ) : " & msj.Text & vbNewLine)
msj.Text = ""
Catch ex As Exception
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
ftp.Credentials = New Net.NetworkCredential("goldpast", "1357911h-")
mp.URL = www & "radyo.bps"
sohbet.Text = web.DownloadString(www & "sohbet.bps")
ad.Text = My.Computer.Name
Timer1.Interval = 3000
Timer1.Start()
Timer2.Interval = 1
Timer2.Start()
Catch ex As Exception
End Try
End Sub
Private Sub msj_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles msj.KeyDown
Try
If e.KeyCode = Keys.Enter Then
gön.PerformClick()
End If
Catch ex As Exception
End Try
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
değer = Len(sohbet.Text)
sohbet.Text = web.DownloadString(www & "sohbet.bps")
If değer < Len(sohbet.Text) Then
ses.URL = "Sesler\ileti.wav"
End If
Catch ex As Exception
End Try
End Sub
Private Sub GroupBox3_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox3.Enter
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
mp.fullScreen = True
Catch ex As Exception
End Try
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Try
If GetAsyncKeyState(Keys.Escape) Then
mp.fullScreen = False
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
ftp.UploadString(alan & "sohbet.bps", "")
ses.URL = "Sesler\sil.wav"
Catch ex As Exception
End Try
End Sub
Private Sub link_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles link.KeyDown
Try
If e.KeyCode = Keys.Enter Then
linkgön.PerformClick()
End If
Catch ex As Exception
End Try
End Sub
Private Sub linkgön_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles linkgön.Click
Try
ftp.UploadString(alan & "radyo.bps", link.Text)
Catch ex As Exception
End Try
End Sub
End Class
ss [/code]