从网络服务器逐行读取txt文件,然后下载文件. [英] Reading txt file from a web server line by line and then download files.

查看:122
本文介绍了从网络服务器逐行读取txt文件,然后下载文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它和外部服务器.该应用程序就像一个应用程序更新程序,它将检查txt文件中的新更新.因此,我上传了一个文本文件,如. patch.txt文件.其中命名的文件将与patch.txt文件上传到同一目录中,以便更新程序可以下载它们.因此,如果我要添加新的更新,则只需上传新文件,然后编辑patch.txt并在其中添加文件名.我希望你明白我的意思.所以我的问题是:如何使它从外部服务器读取文本文件并循环遍历然后下载文件?

我们将不胜感激.

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.

推荐答案

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("::");
}
}


这篇关于从网络服务器逐行读取txt文件,然后下载文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆