返回首页

我保存在临时文件夹的应用程序目录我的形象
我检索要显示图像asp.net
控制,
但图像没有显示

这里下面是代码
plz帮助

String fileName = FileUpload1.FileName;

 

           int newlrmnsdf = fileName.Length;

           int gdf = newlrmnsdf - 4;

           string strwithoutEXT = fileName.Substring(0,gdf);

           string currenttime = System.DateTime.Now.Minute.ToString() + "_";

           string newFileName = strwithoutEXT + currenttime + ".jpg";

           string actualFilename = currenttime + newFileName;

           bool IsExists = System.IO.Directory.Exists(Server.MapPath("temp"));

           if (!IsExists)

           {

               System.IO.Directory.CreateDirectory(Server.MapPath("temp"));

                FileUpload1.SaveAs(Server.MapPath(" /temp/") + actualFilename);

           }

           else

           {

                FileUpload1.SaveAs(Server.MapPath(" /temp/") + actualFilename);

 



           }

           if (fileName.Contains(".pdf"))

           {

               //Image1.Visible = false;

             //  frame1.Attributes.Add("src", "http://localhost:50389/temp/" + actualFilename);

           }

           else

           {

              // frame1.Visible = false;

               //  string url = "http://localhost:50389/temp/" + actualFilename;

               string path = Server.MapPath(" /temp/");

               Image1.ImageUrl = path + actualFilename;

           }

回答

评论会员:s 时间:2