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
Abhineet Srivastava
NA
890
94.7k
How to Delete Subfolder in .cs page
Jul 29 2013 7:36 AM
Hi,
I am saving the file using this Method-
public void SaveDialog(string template, string visatypeid, string folderName, string fileType)
{
string filePath = Server.MapPath("" + folderName + "/" + visatypeid + "/" + fileType + "/" + template + "");
System.IO.FileInfo targetFile = new System.IO.FileInfo(filePath);
FileInfo objFileInfo = default(FileInfo);
try
{
objFileInfo = new FileInfo(filePath);
if (objFileInfo.Exists)
{
Response.Clear();
Response.Cache.SetCacheability(System.Web.HttpCacheability.Private);
Response.AddHeader("Content-Disposition", "attachment; filename=" + objFileInfo.Name);
Response.AddHeader("Content-Length", objFileInfo.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(filePath);
Response.End();
}
else
{
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
cs.RegisterStartupScript(cstype, "onLoadCall", "<script>alert('Template does not exist.'); window.location.href=window.location.href;</script>", false);
}
}
catch (Exception ex)
{
//MsgBox("error")
}
}
File Is Saving like that--Casefile/608/Document/file.txt Formate.
Now,i have to delete the subfolder menas--608/Document/File.txt
Anyone have a idea about how to do it?
Reply
Answers (
5
)
Crystal Reports
Can we display Input data of Test in Nunit Test Result