TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sagar Bhosale
NA
179
176k
How to write image path for deleting perticular image stored in temp folder
Jun 16 2011 5:31 AM
e.g. my suppose my image name is
92e95d97-0575-4
2f6-b08b-8c81a7
2d0b07_3d-windo
ws-8-wallpaper-
ocean--sunset-3
0--1600-x-1200-
jpeg-1280x1024.
jpg
my code below global.asax.cs
protected void Session_End(object sender, EventArgs e) {
string userId = Session["UserId"].ToString();
string path;
string[] filename;
path = System.Web.Hosting.HostingEnvironment.MapPath("~/temp/" +userId); //i have doubt here how write proper image path
filename = Directory.GetFiles(path);
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(filepath.FullName);
Session.Abandon();
}
}
}
}
Reply
Answers (
2
)
how to search xml data (textbox entered data to search xml file)
RAD Grid Data Binding in Silverlight