I am using MonoDevelop for Android and would like some help to download a
text file off the internet.

Here is my code:

        try 
        {
            URL url = new URL("mysite.com/thefile.txt");

            BufferedReader in = new BufferedReader(new
InputStreamReader(url.openStream()));
            String str;
            while ((str = in.readLine()) != null) 
            {
                // str is one line of text; readLine() strips the newline
character(s)
            }

            in.close();
        } 
        catch (MalformedURLException e) 
        {

        } catch (IOException e) 
        {

        }
I am getting the following error:

Invalid expression term 'in';

May I please have some help to get this code working. If there is an easier
way to download a text file off the WWW and save the contents into a string,
may I please have some help to implement it.

Thanks in advance.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Android-Download-Text-File-from-WWW-tp5712733.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to