سلام 😉 در این مطلب از وب سایت پروگرم 98 کد استفاده از Network Client و StreamReader در #C را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
کد استفاده از Network Client و StreamReader در #C :
using System;
using System.Net.Sockets;
using System.Threading;
using System.Text;
public class MainClass
{
public static void Main()
{
int BufferSize = 256;
TcpClient tcpSocket = new TcpClient("127.0.0.1", 65000);
NetworkStream streamToServer = tcpSocket.GetStream();
System.IO.StreamWriter writer = new System.IO.StreamWriter(streamToServer);
writer.Write("message");
writer.Flush();
bool fQuit = false;
while (!fQuit)
using System.Net.Sockets;
using System.Threading;
using System.Text;
public class MainClass
{
public static void Main()
{
int BufferSize = 256;
TcpClient tcpSocket = new TcpClient("127.0.0.1", 65000);
NetworkStream streamToServer = tcpSocket.GetStream();
System.IO.StreamWriter writer = new System.IO.StreamWriter(streamToServer);
writer.Write("message");
writer.Flush();
bool fQuit = false;
while (!fQuit)