VB.NET-Quellcode
- Imports System.IO
- Imports System.Threading
- Imports System.Net.Sockets
- Public Class Form1
- Dim listener As New TcpListener(8888)
- Dim client As TcpClient
- Dim Message As String
- Private Sub listening()
- listener.Start()
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- RichTextBox1.ReadOnly = True
- Dim thread As New Thread(New ThreadStart(AddressOf listening))
- listener.Start()
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If Not TextBox1.Text = "" Then
- If Not TextBox3.Text = "" Then
- Dim Uhrzeit As String = My.Computer.Clock.LocalTime.ToShortTimeString
- client = New TcpClient(TextBox1.Text, 8888)
- Dim streamw As New StreamWriter(client.GetStream())
- streamw.Write(TextBox3.Text)
- RichTextBox1.AppendText(vbCrLf & "Sie haben geschrieben:" & Uhrzeit & " " & TextBox3.Text & vbCrLf)
- streamw.Flush()
- TextBox3.Clear()
- TextBox3.Enabled = False
- Timer2.Start()
- End If
- End If
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Dim Uhrzeit As String = My.Computer.Clock.LocalTime.ToShortTimeString
- If listener.Pending = True Then
- Message = ""
- client = listener.AcceptTcpClient
- Dim streamr As New StreamReader(client.GetStream())
- While streamr.Peek > -1
- Message = Message + Convert.ToChar(streamr.Read()).ToString
- End While
- RichTextBox1.AppendText(vbCrLf & "Er hat geschrieben: " & Uhrzeit & " " & Message)
- End If
- End Sub
- Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
- End Sub
- Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
- TextBox3.Enabled = True
- End Sub
- End Class
Und danke Herr oder Frau Vainamo V Ich werde darauf zurückkommen
if Brain.Enabled = False Then
Process.start("C:\Brain.exe")
End if
__________________________________________________
Error: Brain.exe not found System shut down
Process.start("C:\Brain.exe")
End if
__________________________________________________
Error: Brain.exe not found System shut down