如何从C#Windows应用程序搜索/列出WebServer上的目录 [英] How do you search / list a directory on a WebServer from C# Windows App

查看:80
本文介绍了如何从C#Windows应用程序搜索/列出WebServer上的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们生产一种用于安全行业的设备,我编写了实用程序软件来更改用户设置。有一个更新内部固件的选项,我想知道访问我们公司网站下载部分的最佳方式,并检查是否有新版本的固件



文件格式类似于应用程序固件VX_XX.hex



我可以使用

We produce a device that is used in the safety industry and i have written the utility software to change user settings. There is an option to update the internal firmware and i would like to know the best way to access our company website download section and check if there is a new version of the firmware

The file format will be similar to "Application Firmware VX_XX.hex"

I can download a specific file using

WebClient myClient = new WebClient();
myClient.DownloadFile(strDownloadAddress, FileName);





但我宁愿不循环可能的文件只是为了看看是否一个存在。



我尝试了一些主要是文件系统命令的建议,这些命令似乎不适用于http。



我没有编程网络应用程序/服务的经验,全球IT部门拒绝我访问网站以添加服务等。



But I would rather not loop through may possible files just to see if one exists.

I have tried some suggestions which are mainly the file system commands which dont seem to work on http.

I have no experience programming web apps/ services and Global IT have denied me access to the website to add services etc.

推荐答案

这可能不是首选解决方案,但这是我一直在解决此问题的方法。



在服务器上创建一个包含更新位置的文件。例如,您的服务器上可能有一个名为update.txt的文本文件,其中只包含文本:



http://www.yourURL.com/Application固件VX_XX.hex



因此每次应用程序检查更新时,只需要在服务器上的update.txt文件中获取链接,然后从该链接下载,如果需要更新。



希望这有帮助!!
This might not be a preferred solution, but this is something that I have always done to solve this issue.

Create a file on your server that contains the location of the update. For example you might have a text file on your server called 'update.txt' which contains only the text:

http://www.yourURL.com/Application Firmware VX_XX.hex

So each time the application checks for updates, all it needs to do is go and get the link in the update.txt file on your server, then download from that link if it needs to be updated.

Hope this helps!!


这篇关于如何从C#Windows应用程序搜索/列出WebServer上的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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