Click here to Skip to main content
Rate this: bad
good
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 13:04pm
maxbre319
Edited 31-Oct-12 0:50am
v4
Comments
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.
--SA

1 solution

Rate this: bad
good
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("::");
}
}
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 319
1 Maciej Los 295
2 Sergey Alexandrovich Kryukov 230
3 CPallini 205
4 Sinisa Hajnal 166
0 OriginalGriff 7,760
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,785


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2014
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