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
175.6k
How to delete image according to intial string of the images
Jun 17 2011 8:38 AM
Hi friend, i have one problem that in my project temp folder where i upload images according userid so images is uploaded in temp folder in this manner userid_abc.jpg in this format
so my problem is that how to delete that images according that userid
using foreach loop how i collect images according to userid then matching that userid how i will delete images pleaz help me i very trouble to find out solution
i want to my code in above format how can i do this pleaz help me
my code is global.asax.cs
protected void Session_End(object sender, EventArgs e) {
string userId = Session["UserId"].ToString();
string path;
string ImagePath =Session["Imagepath"].ToString();
path = System.Web.Hosting.HostingEnvironment.MapPath("~/temp/" + userId + "_" + ImagePath);
FileInfo filepath = new FileInfo(path);
if (filepath.Exists) {
File.Delete(filepath.FullName);
Session.Abandon();
}
}
Reply
Answers (
6
)
how to display xml data searching values in listbox
how to set background image in windows mobile forms listview