如何在单个文件夹中存储名称文件? [英] How to store file with name in single folder?
本文介绍了如何在单个文件夹中存储名称文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将名称中的文件存储在单个文件夹中而不替换旧文件....如何操作。感谢先生...........
I want to store file with name in single folder without replacing old file....How to do it.??Thanks in advnce...........
推荐答案
private string getimage(string url)
{
string remoteImgPath = url;
Uri remoteImgPathUri = new Uri(remoteImgPath);
string remoteImgPathWithoutQuery = remoteImgPathUri.GetLeftPart(UriPartial.Path);
string file = Path.GetFileName(remoteImgPathWithoutQuery);
string fileName = file.Save(file, "profile_img_" + Userid);
string localPath = AppDomain.CurrentDomain.BaseDirectory + "content\\uploads\\profile\\" + fileName+".jpg";
WebClient webClient = new WebClient();
webClient.DownloadFile(remoteImgPath, localPath);
return localPath;
}
这篇关于如何在单个文件夹中存储名称文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文