如何编写从服务器上载文件或图像的路径? [英] How to write a path for upload a file or image from my server?

查看:217
本文介绍了如何编写从服务器上载文件或图像的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从服务器上获取文件.路径已在局域网中连接到应用程序(在我的本地系统中)中创建,就像@"...........\"怎么可能?

先生,请帮我...

I want to take files from my server. The path has created in application (in my local system) connecting in LAN, like @"...........\" how it is possible?

please help me sir...

SaveFileDialog sfdBackUpPath = new SaveFileDialog();
sfdBackUpPath.Title = "Select File To Upload";
sfdBackUpPath.InitialDirectory = @"server2\";
DateTime DT = DateTime.Today;
sfdBackUpPath.FileName = "FAMS_" + DT.ToString("yyyyMMdd");
sfdBackUpPath.Filter = "BAK files (*.*)|*.bak";
sfdBackUpPath.FilterIndex = 1;
sfdBackUpPath.RestoreDirectory = true;
if (sfdBackUpPath.ShowDialog() == DialogResult.OK)
{
       if (sfdBackUpPath.FileName != "")
       {
            int index = sfdBackUpPath.FileName.IndexOf(".bak");
            this.txtFile.Text = sfdBackUpPath.FileName.Remove(index, 4);
       }
}

推荐答案

您要从应用程序浏览服务器的文件系统吗?您可以执行此操作,但这取决于服务器以及对它的访问权限.从理论上讲,您可以将UNC路径(例如@"\\ servername \ c
You want to browse the file system of your server from an application? You can do it, but it depends on the server, and the access you have to it. Theoretically you can use UNC paths like @"\\servername\c


\ Windows"用于管理员共享,或将@"\\ servername \ sharename"用于普通共享).是Windows服务器,或者您具有samba,并且您有权浏览.使用其他协议时,您可能需要记住其他附加功能.您甚至可以通过http,ftp,webdav或其他已注册的协议处理程序浏览文件列表.
\Windows" for admin shares or @"\\servername\sharename" for normal shares... but only if they are windows servers or you have samba on it, and you have the right to browse. With other protocols you might have other extras to keep in mind. You can even browse file lists over http, ftp, webdav, or other registered protocol handlers.


这篇关于如何编写从服务器上载文件或图像的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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