if (!Directory.Exists(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//OriginalImages"))
{
Directory.CreateDirectory(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//OriginalImages");
}
if (File.Exists(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//" + fuImageName.FileName.ToString()))
{
File.Delete(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//" + fuImageName.FileName.ToString());
}
if (File.Exists(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//OriginalImages//" + fuImageName.FileName.ToString()))
{
File.Delete(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//OriginalImages//" + fuImageName.FileName.ToString());
}
fuImageName.SaveAs(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//" + fuImageName.FileName.ToString());
if (!Directory.Exists(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//ThumbNailImages"))
{
Directory.CreateDirectory(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//ThumbNailImages");
}
string Path = Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//" + fuImageName.FileName.ToString();
Bitmap bmp1 = CreateThumbnail(Path, 400, 500);
string OutputFilename1 = fuImageName.FileName.ToString();
bmp1.Save(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//OriginalImages//" + OutputFilename1.ToString(), System.Drawing.Imaging.ImageFormat.Jpeg);
bmp1.Dispose();
Bitmap bmp = CreateThumbnail(Path, 100, 100);
string OutputFilename = "Thumb_" + fuImageName.FileName.ToString();
bmp.Save(Request.PhysicalApplicationPath + "Images//Products//" + ddlCategory.SelectedValue.ToString().Trim() + "//" + ProductMasterId.ToString().Trim() + "//ThumbNailImages//" + OutputFilename.ToString(), System.Drawing.Imaging.ImageFormat.Jpeg);
bmp.Dispose();
ClearAll();
这是我的代码..我在服务器上运行得到这个错误
System.Security.SecurityException:请求“System.Security.Permissions.FileIOPermission,mscorlib,版本=2.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089”类型的权限失败......
请解决这个错误......