找不到文件路径的一部分

问题描述 投票:0回答:1

我遇到它指出该文件路径的一部分,不能被发现。我是相当新的编码,但这个错误很明显?

I've created the same application before off a USB

其工作正常,那么,为什么我的机器上的应用程序是不是很迷茫。

Error message itself

更新 - 谢谢你的意见为止。

c# filepath
1个回答
1
投票

假设你想你想行33更改为\图像的相对目录:

filename = Path.Combine(Server.MapPath("~/Image"), fileName);

这是因为丢失了波浪线“〜”,使其相对。

© www.soinside.com 2019 - 2024. All rights reserved.