如何提供从serever获取文件的路径? [英] how to give a path to get a file from serever ?

查看:77
本文介绍了如何提供从serever获取文件的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过这个



picEmpProfile.Image = Image.FromFile(\\192.168.2.125\Uploads\9240.jpg)

picEmpProfile.Image = Image.FromFile(\\192.168.2.125\c\inetpub\wwwroot\hr\Uploads\9240.jpg)





pleae help?

i have tried this

picEmpProfile.Image = Image.FromFile("\\192.168.2.125\Uploads\9240.jpg")
picEmpProfile.Image = Image.FromFile("\\192.168.2.125\c\inetpub\wwwroot\hr\Uploads\9240.jpg")


pleae help ?

推荐答案

如果是窗口



Application.StartupPath +您的文件夹名称或路径
And If Window

Application.StartupPath + Your Folder Name Or Path


Web或窗口应用程序



如果是Web

只需使用System.startup路径,它将为您提供运行应用程序的路径,然后只需添加文件夹和文件名





For Exapmle: -

Server.MapPath(〜/ FileManager /);





享受
Web Or Window Application

If Web
Just Use System.startup path it will give you the path from where application is running then just add folder and file name


For Exapmle :-
Server.MapPath("~/FileManager/");


Enjoy


这篇关于如何提供从serever获取文件的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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