Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Updated 30-Oct-12 23:50pm
v4
Comments
AspDotNetDev 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 30-Oct-12 18:44pm    
Not a question. If you say "I want", you can do it.
--SA

1 solution

C#
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("::");
}
}
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900