Asp.Net:在路径位置保存文件
答
假设rootPath
是包含根路径变量,fileName
是文件要保存的名字:
var filePath = System.IO.Path.Combine(rootPath, fileName);
我不知道是什么形成文件中存在如果包括,我可以给出更好的指示,说明如何处理filePath
。
using (var outputStream = File.Open(filePath, FileMode.CreateNew))
{
// write to outputStream; depends on what form your PDF file is in at this point.
}
你能改说你的问题吗?目前它确实没什么意义。 –
Downvoting,因为有人帮助你,你没有回应他们。 – halfer