CODE编写如何将图像存储在服务或sp(路径)的文件夹中? [英] CODE to write how to store image in a folder from service or sp(path)?
本文介绍了CODE编写如何将图像存储在服务或sp(路径)的文件夹中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将图像存储在c#中的文件夹中。
我尝试过:
string iName = File.FileName;
File.Copy(iName,File.Combine(@ \\\192.168.10.47 \D:\inetpub \ -wwwroot) \ Orbitsys \Images \Dealer_NetworkAdd.GetFileName(iName)));
解决方案
你写的不是有效的URL,也不是有效的文件路径。File.Copy
需要文件路径名,而不是URL。如果这是一个ASP.NET应用程序,并且您有一个有效的URL,相对或绝对,您需要在该站点的主机的文件系统中找到文件路径名: http://www.dotnetperls.com/mappath 。
-SA
Code how to store image in a folder in c#.
What I have tried:
string iName = File.FileName;
File.Copy(iName, File.Combine("@\192.168.10.47\D:\inetpub\wwwroot\Orbitsys\Images\Dealer_Network" Add.GetFileName(iName)));
解决方案
What you wrote is not a valid URL, nor it's a valid file path.File.Copy
needs file path name, not URL. If this is an ASP.NET application, and you have a valid URL, relative or absolute, you need to find out the file path name in the file system of the site's host: http://www.dotnetperls.com/mappath.
—SA
这篇关于CODE编写如何将图像存储在服务或sp(路径)的文件夹中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文