首页 > 解决方案 > 图片保存在服务器崩溃中

问题描述

\我需要很多用户编辑这个系统。但是图片保存了另一个用户条目。

如何解决这个问题呢

DocX 文档

     for (int i = 1; i <= 2; i++)
                        {
                            if (i == 1) { Paragraph title = document.InsertParagraph().Append("" + TempData["Vkorg"] + "").FontSize(20); title.Alignment = Alignment.center; }
                            if (i == 1) { Paragraph title = document.InsertParagraph().Append("" + Urun + "").FontSize(20); title.Alignment = Alignment.center; }
  }

                            var myImageFullPath = Path.Combine(Server.MapPath("\\Resim\\") + i + ".jpg");

                            {
                                // Add an image into the document.    
                                Image image = document.AddImage(myImageFullPath);

                                // Create a picture (A custom view of an Image).
                                Picture picture = image.CreatePicture(400, 600);
                                // Insert a new Paragraph into the document.
                                if (i == 1) { Paragraph title = document.InsertParagraph().Append("" + Explanation1 + "").FontSize(12); title.Alignment = Alignment.center; }
                                if (i == 2) { Paragraph title = document.InsertParagraph().Append("" + Explanation2 + "").FontSize(12); title.Alignment = Alignment.center; }
             }
      }
                                // Insert a new Paragraph into the document.
                                Paragraph p1 = document.InsertParagraph();
                                // Append content to the Paragraph
                                p1.AppendPicture(picture);
                                //p1.AppendLine();
                                //p1.AppendPicture(picture);
                                // Save this document.                    
                            }
                            document.Save();
                        }
        }

标签: crashsave

解决方案


推荐阅读