删除图片中出现的问题
SqlConnection mycon = new SqlConnection(ConfigurationManager.AppSettings["Connstr"]);
string SQL = "select ImageUrl from gonggaoxinxi where zhanhui_id='" + e.CommandName + "'";
SqlCommand cmd = new SqlCommand(SQL,mycon);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@zhanhui_id",SqlDbType.Int);
cmd.Parameters["@zhanhui_id"].Value = SQL;
mycon.Open();
string filePath = @"images\NewsPic\" + cmd.ExecuteScalar().ToString();
if(File.Exists(filePath))
{
File.Delete(filePath) ;
}