Click here to Skip to main content
11,801,910 members (55,068 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# read
Hi, Its and external server. The application is like an application updater that will check for new updates in a txt file. So I have a text file uploaded like this. The files that I want to be downloaded is named in that patch.txt file. The files named in there will be uploaded in the same directory as the patch.txt file so the updater can download them. So If I want to add a new update then I should only need to upload the new file and then edit the patch.txt and add the name of the file in there. I hope you understand what I mean. So my question is: How can I make it read a text file from an external server and loop through them and then download the files?

Any help would be appreciated.
Posted 30-Oct-12 12:04pm
Edited 30-Oct-12 23:50pm
AspDotNetDev at 30-Oct-12 18:32pm
What problem are you having with your code? Is the file local to the server the webpage is running from, or is it on an external server? Do you actually want to read each line consecutively, or do you want to just dump the contents of the entire file into a textbox?
Sergey Alexandrovich Kryukov at 30-Oct-12 18:44pm
Not a question. If you say "I want", you can do it.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

string curFileMenu = @"C:\Accounting\Accounting\Accounting\TextFileMenu.txt";
            if (File.Exists(curFileMenu))
                string[] menunames = System.IO.File.ReadAllLines(curFileMenu);
                foreach (string menuname in menunames)
                    lnLenght = menuname.Length;
                    lnLenghtLast = menuname.IndexOf("::") + "::".Length;
                    lnLenghtFirst = menuname.LastIndexOf("::");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 445
1 KrunalRohit 301
2 F-ES Sitecore 215
3 CHill60 185
4 Afzaal Ahmad Zeeshan 180
0 OriginalGriff 2,715
1 Maciej Los 1,900
2 KrunalRohit 1,797
3 CPallini 1,550
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100