Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Member 10619797

@Member 10619797
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to implement this code for multiple clients using c sharp
    M Member 10619797

    the above c sharp code will send client desktop images to server . it works for single client . we want to implement this for multiple client. please provide help to implement it. SERVER code:-

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.Remoting;
    using System.Linq;
    using System.Text;
    using System.Net .Sockets ;
    using System.Windows.Forms;
    using System.Threading ;
    using System.Runtime.Serialization.Formatters.Binary;
    using System.Net;

    namespace simpleserver
    {
    public partial class Form2 : Form
    {
    private readonly int port;
    private TcpClient client;
    private TcpListener server;
    //static public int MAX_CONN = 5;
    private NetworkStream mainstream;
    //private string ipList;
    //TcpListener myList = null;

    //static int thrd = -1;

        private readonly Thread Listening;
        private readonly Thread Getimg;
        public Form2(int Port)
        {
            port = Port;
            client = new TcpClient();
            Listening = new Thread(StartListening);
            Getimg = new Thread(ReceiveImage);
            InitializeComponent();
        }
    
    
        private void StartListening()
        {
            while (!client.Connected)
            {
                //ipList = new string\[MAX\_CONN\];
                //myList = new TcpListener(hostIP, hostPort);
                //myList.Start();
    
               server.Start();
               client = server.AcceptTcpClient();
    
               
            }
            Getimg.Start();
            
        }
        private void stop()
        {
            server.Stop();
            client = null;
            if (Listening .IsAlive )Listening .Abort ();
            if ( Getimg .IsAlive )Getimg .Abort ();
        }
        private void ReceiveImage()
        {
            BinaryFormatter binformatter = new BinaryFormatter();
            while (client.Connected)
            {
                mainstream = client.GetStream();
                pictureBox1.Image =(Image ) binformatter.Deserialize(mainstream);
              //  pictureBox2 .Image =(Image )binformatter .Deserialize (mainstream );
    
            }
    
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            server = new TcpListener(IPAddress .Any ,port  );
            Listening .Start ();
        }
    
    C# csharp linq graphics sysadmin json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups