【发布时间】:2020-06-25 16:16:26
【问题描述】:
我在 wwwroot 文件夹中有一个名为 Images 的文件夹。我想将图像保存到该文件夹。现在图像被保存在 wwwroot 文件夹(在 Images 之外),并且保存的图像的名称以 Images 开头。这是我正在使用的代码:
string filepath = Path.Combine(_caminho.WebRootPath, "Images" + name);
"name" 是具有图像名称的字符串。为什么会这样?
【问题讨论】:
-
看起来“图片”被添加到名称前。在没有看到更多代码的情况下,我不得不假设您应该这样做:
string filepath = Path.Combine(_caminho.WebRootPath, "Images", name);
标签: c# visual-studio asp.net-core