Tuesday, January 26, 2010

Delete The Iamge From Server / Save the Serve Space

Delete The Iamge From Server
private void DeleteFile(string strFileName1)
{
strFileName1 = filename1;
string str1 = Server.MapPath(“../upload/category/”) + strFileName1;
if (str1.Trim().Length > 0)
{
FileInfo fi1 = new FileInfo(str1);
if (fi1.Exists)
{
fi1.Delete();
}
}
}