title: How to convert list items to ASCII Encodings in C#
body: <p>I was developed client and server chat application using on Socket programming...</p>
  
  <p>My question is, how to convert a list of string items into ASCII Encodings.
  Is there any way to use it?</p>
  
  <p>My server side List is this :</p>
  
  <pre><code>  public static List&lt;string&gt; NickNameList = new List&lt;string&gt;();
  </code></pre>
  
  <hr>
  
  <p>here, I add my client's nick names to the list.</p>
  
  <pre><code>                Socket socket = socketClient as Socket;
                  byte[] bs = new byte[1024];
                  int ks = socket.Receive(bs);
  
                  string RecievedSocket = Encoding.ASCII.GetString(bs, 0, ks);
  
                  NickNameList.Add(RecievedSocket);
  </code></pre>
  
  <hr>
  
  <p>And Lastly, I was tried to send back the list to the client which I saved on my NickNameList in the server.</p>
  
  <pre><code>   ASCIIEncoding asen = new ASCIIEncoding();
     socket.Send(asen.GetBytes(listBox1.Items.ToString()));
  </code></pre>
  
  <p>But I don't know how to get a list of clients not converting into a string. Is there a way to send a list directly with ASCII Encoding?</p>
  
  <p>If you know anything about this, Please let me know...</p>