如何使用数据库中的filepath从服务器下载文件? [英] How do I download a file from server using filepath from database?

查看:68
本文介绍了如何使用数据库中的filepath从服务器下载文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个应用程序(Winform),我需要使用保存在数据库中的文件路径下载文件。我试过谷歌搜索,但我真的不知道从哪里开始。



示例:

---------- --------------------

ID:1

文件路径:host / test.txt

------------------------------

[BUTTON]







单击按钮时,我想使用文件(从文件服务器)将文件下载到特定文件夹客户端PC?



我真的非常需要它。有链接吗?或者教程?

感谢提前! :)

解决方案

正如您所提到的文件服务器,很可能是指Windows文件共享服务,它可以与任何其他文件系统使用完全相同的名称,所以您可以像复制任何其他文件一样复制/移动/重命名/删除文件,具体取决于权限等。对于文件命名,您需要使用UNC名称:

http://en.wikipedia.org/wiki/Path_%28computing%29#Uniform_Naming_Convention [ ^ ]。



-SA


从这里开始:如何:在Visual Basic中下载文件 [ ^ ]

如果要从ftp s下载文件请关注此链接:如何:使用FTP下载文件 [ ^ ]



您可以像这样访问服务器上的文件:

\\servername \directory\subdirectory\\\
ameoffile


或通过映射:

Z:\ nameoffile

其中

Z:等于 \\servername \directory\subdirectory \



其他有用的信息,你可以在这里找到:如何:在Visual Basic中解析文件路径 [ ^ ]

Shared文件夹 [ ^ ]

I have this application (Winform) where in I need to download a file using the file path saved on the database . I tried googling but I really don't know where to start.

Example:
------------------------------
ID:1
Filepath: host/test.txt
------------------------------
[BUTTON]



When I click the button, I want to download the file (from a file server) to a specific folder using a client PC?

I really need it badly. Any links? or tutorials?
THANKS IN ADVANCE! :)

解决方案

As you mentioned a file server, most likely you mean Windows file sharing service, which can be used in exact same name as any other file system, so you can copy/move/rename/delete files in the same way as any other file, depending on permissions, etc. For file naming, you need to use UNC names:
http://en.wikipedia.org/wiki/Path_%28computing%29#Uniform_Naming_Convention[^].

—SA


Start here: How to: Download a File in Visual Basic[^]
If you want to download file from ftp server, please follow this link: How to: Download Files with FTP[^]

You can access to the file on server like this:
\\servername\directory\subdirectory\nameoffile
or via mapping:
Z:\nameoffile
where
Z: is equal to \\servername\directory\subdirectory\

Other useful information, you'll find here: How to: Parse File Paths in Visual Basic[^]
Shared folders[^]


这篇关于如何使用数据库中的filepath从服务器下载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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