how to close a file and delete that image file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • girikassss
    New Member
    • Jun 2012
    • 1

    how to close a file and delete that image file?

    Code:
    Imagename = objUser.UserID + filename;
                        Imagepath = "D:\\Shop\\ShopMonkey\\Images" + Imagename;
                        FileUpload.SaveAs(Path.Combine(@"D:\ShopMonkey_Web_21-6-12\ShopMonkey\Images", Imagename));
    
    objUser.UploadImagePath = Imagepath;
    
    objUser.UploadImagename = Imagename;
    System.Drawing.Image img1 = System.Drawing.Image.FromFile(Imagepath);
    System.Drawing.Image bmp1 = img1.GetThumbnailImage(50, 50, null, IntPtr.Zero);
    ThumbNailPath = "D:\\ShopMonkey_Web_21-6-12\\ShopMonkey\\ThumbNails" + Imagename;
                        bmp1.Save(Path.Combine(@"D:\ShopMonkey_Web_21-6-12\ShopMonkey\ThumbNails", Imagename));
                        objUser.UploadThumbnailPath = ThumbNailPath;

    how to delete the image and thumbnail in other function??(its necessary to close that first r not??? please guide me)


    pleasse help me friends??
    Last edited by PsychoCoder; Jun 23 '12, 06:45 PM. Reason: Code tags added
Working...