C#上传图片源码
来源:互联网 发布:linux创建用户脚本 编辑:程序博客网 时间:2024/05/13 15:25
Random seed = new Random();
string oriFileName = _file.FileName.Trim();
if (oriFileName.Length <= 0)
{
return;
}
string oriFileExtName = Path.GetExtension(oriFileName);
string saveFileName = string.Format("{0}{1}{2}", DateTime.Now.ToString("yyyyMMddHHmmssfff"), seed.Next(1000, 10000), oriFileExtName);
string filePath = Server.MapPath(string.Format("~/Upload/{0}", saveFileName));
try
{
if (!Directory.Exists(Path.GetDirectoryName(filePath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
}
_file.SaveAs(filePath);
Common.PageMethods.Script(this, string.Format("parentShowFileName(\"{0}\",\"{1}\")", oriFileName, saveFileName));
}
catch (Exception err)
{
Common.PageMethods.Script(this, string.Format("parentShowError(\"{0}\")", err.Message));
}
- C#上传图片源码
- 剪切上传图片源码
- 上传图片功能源码
- JSP上传图片源码
- c#图片上传,附件上传
- c#上传图片预览
- mvc c#上传图片
- C# WebService 上传图片
- C# 模拟上传图片
- c#上传图片
- C# 模拟上传图片
- C#实现上传图片
- c#上传图片
- C# 图片上传类
- C#文件、图片上传
- Thinkphp图片上传功能源码
- 上传图片上传项目源码中
- VS2005图片上传源码 ASP.NET 图片上传源码 asp:FileUpload 图片上传源码
- [JAVA] Spring常用注解
- 乘法口诀表(C语言for循环)
- AS打包aar文件的方法及使用总结
- iOS日历视图 FSCalendar的使用
- Spring实现AOP的4种方式
- C#上传图片源码
- 『詩解』八方捷报随春至,在前尽忠又立功的动物
- SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
- ogre 引擎 框架追踪 第五章 资源加载之实加载
- Spring入门学习之Spring MVC(part 2)
- mutating关键字的使用
- NGINX+php+mysql centos6.5配置
- 二、node (Express) Ejs Angular 移动端开发
- H5获取向下一个页面传值并接收参数