string sourcePhotoPath = this.GetUserSelectedPhoto();
if(sourcePhotoPath == null)
{
return;
}
string sourceFileName = System.IO.Path.GetFileName(sourcePhotoPath);
//把图片保存到文件夹
string userName = this.LoginUserName;
string newPath = @"Images";
if(!System.IO.Directory.Exists(newPath))
{
System.IO.Directory.CreateDirectory(newPath);
}
string destFile = userName + DateTime.Now.ToString("yyyyMMddHHMMss") + "_" + sourceFileName;
string destImgPath = System.IO.Path.Combine(newPath, destFile);
if(!File.Exists(destImgPath))
{
var myFile = File.Create(destImgPath);
myFile.Close();
}
FileInfo f1 = new FileInfo(sourcePhotoPath);
f1.CopyTo(destImgPath,true);

  

最新文章

  1. VS web项目 基于IIS调试和模拟域名调试
  2. nodejs学习笔记一——nodejs安装
  3. solr6.0.0 + tomcat8 配置问题
  4. webservice jsonp格式调用
  5. mac本用WTG(Windows To Go)安装Win10到移动硬盘
  6. BiliBili 第三方 Android 客户端应用源码
  7. 省略号 对单行 多行的css
  8. Android 自定义RecyclerView 实现真正的Gallery效果
  9. Using the Cordova Camera API
  10. codevs 1378选课 树形DP
  11. Entity Framework菜鸟初飞
  12. 【递推】BZOJ 4300:绝世好题
  13. 基于HTML5的SLG游戏开发(一):搭建开发环境(1)
  14. java中值类型与引用类型的关系
  15. OGG选择捕捉和应用模式
  16. 8、判断三角形ABC中是否有点D
  17. ngxs 状态管理器
  18. AngularJS 项目里使用echarts 2.0 实现地图功能
  19. Matlab 2016b 正式版下载
  20. Qwe中的数值结算

热门文章

  1. 紫书 习题 11-17 UVa 1670 (图论构造)
  2. 【codeforces 411B】Multi-core Processor
  3. inux 虚拟机桥接模式 静态ip设置,桥接才是王道
  4. 不安全的直接对象引用:你的 ASP.NET 应用数据是否安全?
  5. Centos7+httpd+fastcgi+rails安装
  6. angularjs ng-app
  7. jquery操作select的各种方法
  8. shell加法运算及i++
  9. Slimming Paint (a.k.a. Redesigning Painting and Compositing)
  10. python-排序算法 冒泡和快速排序