String[] / ArrayList Problems

    Date: 01/19/05 (C Sharp)    Keywords: no keywords

    I've written a class that queries game servers on the on the Quake3 network type, and I've come into a small problem. After you send the status packet to the server, it responds back with one packet, with each part being separated by a line break. (Line 1 = useless start, Line 2 = Server Info, Line 3 = Playerinfo.) After I split it, (using '\n') I can easily access each part, but not in the way I need to. All I need to do is add _Response[1] to the arraylist, but I get an error... heres what I tried.

    string[] _newResponse = _Response.Spilt('\n');

    Console.WriteLine(_newResponse[0]); // Outputs the useless packet start
    Console.WriteLine(_newResponse[1]); // Outputs all server info
    Console.WriteLine(_newResponse[2]); // Outputs all player info

    foreach(string Val in _newResponse[1]) // ERROR: Cannot convert type 'char' to 'string'
    {
    ServerVars.Add(Val);
    }


    Any ideas? Thanks.

    Source: http://www.livejournal.com/community/csharp/23194.html

« fast set || Interfaces »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home