1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Development Need help with c#

Discussion in 'Software' started by jamsand, 7 Apr 2014.

  1. jamsand

    jamsand Minimodder

    Joined:
    21 May 2011
    Posts:
    1,259
    Likes Received:
    67
    Hey bit-tech struggling to find something specific online but here is what I'm after. I am trying to list off all files inside my current working directory. Which I have working it stores all the files directories inside a string array and using a foreach loop it writes each one to the client.
    However the client only has one read.readline on the other side so the other 3 values in this case are stored in the que and creating a backlog of files. How can I make a loop that will read all the values in and display them or convert the array into a single string value that can be sent and displayed
    pastebin to code

    http://pastebin.com/4sHrHv0H
     
  2. Cerberus90

    Cerberus90 Car Spannerer

    Joined:
    23 Apr 2009
    Posts:
    7,666
    Likes Received:
    208
    I'm still a relative beginner with C# and don't fully understand the problem/description and haven't done anything with client/server stuff, but just a quick idea, would StringBuilder be of use?
     
  3. jamsand

    jamsand Minimodder

    Joined:
    21 May 2011
    Posts:
    1,259
    Likes Received:
    67
    I stringbuilder is exactly what I need by looks of it but don't understand how to use it yet

    Sent from my GT-I9300 using Tapatalk
     
  4. jamsand

    jamsand Minimodder

    Joined:
    21 May 2011
    Posts:
    1,259
    Likes Received:
    67
    So after little more digging it appears you can concatenate an array into a single string but I'm not sure how that's done
     
  5. Cerberus90

    Cerberus90 Car Spannerer

    Joined:
    23 Apr 2009
    Posts:
    7,666
    Likes Received:
    208
    This looks like it might cover it quite well.
    Shows the String Builder and the string.Join() function.
     

Share This Page