if (fileEx == "jpg" || fileEx == "bmp" || fileEx == "gif")
{
System.Drawing.Image image, newimage,newimage2;
image = System.Drawing.Image.FromFile(filePath); // 其他机上传时提示出现异常错误,但是本机没问题 ... 问题出在那里???? System.Drawing.Image.GetThumbnailImageAbort callb = null;
newimage = image.GetThumbnailImage(50, 50, callb, new System.IntPtr());
newimage2 = image.GetThumbnailImage(100, 100, callb, new System.IntPtr());
newimage.Save(serverpath);
newimage2.Save(serverpath2);
newimage.Dispose();
newimage2.Dispose();
}
else
{
}
{
System.Drawing.Image image, newimage,newimage2;
image = System.Drawing.Image.FromFile(filePath); // 其他机上传时提示出现异常错误,但是本机没问题 ... 问题出在那里???? System.Drawing.Image.GetThumbnailImageAbort callb = null;
newimage = image.GetThumbnailImage(50, 50, callb, new System.IntPtr());
newimage2 = image.GetThumbnailImage(100, 100, callb, new System.IntPtr());
newimage.Save(serverpath);
newimage2.Save(serverpath2);
newimage.Dispose();
newimage2.Dispose();
}
else
{
}
解决方案 »
- webservice去掉<string xmlns="http://tempuri.org/">
- C# 数据库操作的类
- 动态创建droplist问题
- 播放器问题
- 时间函数问题
- 请问各位怎样才能取得浏览者连接服务器的网络速度?
- 思归 孟子E章等高手过来帮帮忙 谢谢先 想了好久 也看了不少csdn的帖子 头涨了
- 我的WEB application 有写xml 到服务器上,但是系统不让写,怎样设置自IIS
- 是否可以用sharepoint来解决web 环境下word文档的创建、编辑、保存?
- 裝了Visual Studio .Net 的請進...
- 请问“当当网”这个效果是怎么实现的?
- 求一个用.NET实现的商品对比功能
-------------------------------------------------------------------------------------------------------说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.FileNotFoundException: D:\Backup\我的文档\My Pictures\pc.jpg源错误:
行 106: //image = System.Drawing.Image.FromFile(filePath);
行 107: ////System.Drawing.Image image = System.Drawing.Image.FromFile(filePath);
行 108: System.Drawing.Image image = System.Drawing.Image.FromFile(filePath);
行 109: //image = System.Drawing.Image.FromFile(Server.MapPath(filePath));
行 110:
堆栈跟踪:
[FileNotFoundException: D:\Backup\我的文档\My Pictures\pc.jpg]
System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) +388162
System.Drawing.Image.FromFile(String filename) +6
Users.UploadImage_OnClick(Object sender, EventArgs e) in f:\ASP.NET\txl\Users.aspx.cs:108
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
只能获取本机文件~
不能用于上传~
只能是本地路径!!!
System.Drawing.Image.FromFile();
只能是本地路径!!!没有人给出答案的情况下 ...采取以下方法:就将上传的图片先保存,然后调用处理,处理完后就将原图删除 ...
只能是本地路径!!!