السلام عليكم ورحمة الله وبركاته
أرجوا منك شرح هذه الاكواد ,,, وشكراً
If order = "notepad" Then
System .Diagnostics. Process .Start ("notepad")
Else If order = "calc" Then
System .Diagnostics .Process .Start ("calc ("
Else
MessageBox .Show("Sorry Sir Your Request is not in my hand", order)
End If
Mytcpl .Stop()
If mysocket .Connected = True Then
Do While True
our_Server()
Loop
End If
End SubPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myth As Thread
myth = New Thread(New System.Threading.ThreadStart(AddressOf our_Server)) myth.Start()
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
mytcpl.Stop()
Application.ExitThread()
Application.Exit()
Catch ex As Exception
MessageBox.Show (ex.Message)
End Try
End Sub
End ClassPrivate mysr As StreamReader
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Try
Dim myclient As TcpClient = New TcpClient(txt_host.Text, 5020)'
Dim myns As NetworkStream = myclient.GetStream()'
Dim mysw As StreamWriter = New StreamWriter(myns)'
mysw.WriteLine(txt_msg.Text)
mysw.Close()
myns.Close()
myclient.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.label2 = New System.Windows.Forms.Label
Me.label1 = New System.Windows.Forms.Label
Me.txt_host = New System.Windows.Forms.TextBox
Me.button1 = New System.Windows.Forms.Button
Me.txt_msg = New System.Windows.Forms.TextBox
Me.Button2 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'label2
'
Me.label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(178, Byte))
Me.label2.Location = New System.Drawing.Point(12, 47)
Me.label2.Name = "label2"
Me.label2.Size = New System.Drawing.Size(88, 23)
Me.label2.TabIndex = 9
Me.label2.Text = "Your Request"
'
'label1
'
Me.label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(178, Byte))
Me.label1.Location = New System.Drawing.Point(12, 15)
Me.label1.Name = "label1"
Me.label1.Size = New System.Drawing.Size(80, 23)
Me.label1.TabIndex = 8
Me.label1.Text = "Server"
'
'txt_host
'
Me.txt_host.Location = New System.Drawing.Point(100, 15)
Me.txt_host.Name = "txt_host"
Me.txt_host.Size = New System.Drawing.Size(144, 20)
Me.txt_host.TabIndex = 7
Me.txt_host.Text = "localhost"
'
'button1
'
Me.button1.Location = New System.Drawing.Point(169, 79)
Me.button1.Name = "button1"
Me.button1.Size = New System.Drawing.Size(75, 23)
Me.button1.TabIndex = 6
Me.button1.Text = "Send"
'
'txt_msg
'
Me.txt_msg.Location = New System.Drawing.Point(100, 47)
Me.txt_msg.Name = "txt_msg"
Me.txt_msg.Size = New System.Drawing.Size(144, 20)
Me.txt_msg.TabIndex = 5
Me.txt_msg.Text = "notepad"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(15, 79)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 10
Me.Button2.Text = "Exit"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.PaleGreen
Me.ClientSize = New System.Drawing.Size(255, 114)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.label2)
Me.Controls.Add(Me.label1)
Me.Controls.Add(Me.txt_host)
Me.Controls.Add(Me.button1)
Me.Controls.Add(Me.txt_msg)
Me.Name = "Form1"
Me.Text = "Client Side"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private WithEvents label2 As System.Windows.Forms.Label
Private WithEvents label1 As System.Windows.Forms.Label
Private WithEvents txt_host As System.Windows.Forms.TextBox
Private WithEvents button1 As System.Windows.Forms.Button
Private WithEvents txt_msg As System.Windows.Forms.TextBox
Private WithEvents Button2 As System.Windows.Forms.Button
End Classالرجاء شرحها