my global.asax.cs code please help me
protected void Session_End(object sender, EventArgs e) {
string uId = Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString();
string path;
string[] filename;
path = System.Web.HttpContext.Current.Server.MapPath(@"\Images");
filename = Directory.GetFiles(uId + "_" + path[path.Length - 1]);
for (int i = 0; i < filename.Length; i++) {
if (Session.SessionID == Path.GetFileName(filename[i])) {
string imgpath = filename[i];
FileInfo filepath = new FileInfo(imgpath);
if (filepath.Exists) {
File.Delete(Server.MapPath("~/temp/" + filepath.FullName));
Session.Abandon();
}
}
}
}

Suthish NairPosted Jun 18, 2011, 4:23 AM
Suthish NairPosted Jun 14, 2011, 6:52 AM
Session.Abandon method destroys all the objects stored in a Session object and releases their resources. You need write separate logic to delete the physical files.
sagar BhosalePosted Jun 14, 2011, 6:41 AM
Suthish NairPosted Jun 14, 2011, 6:27 AM
sagar BhosalePosted Jun 14, 2011, 6:15 AM
Suthish NairPosted Jun 14, 2011, 6:04 AM