SqlConnection objSqlConnection = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnString"]);objSqlConnection.Open();//删除图片string str1="select * from lnjg where id="+i;SqlCommand myOldCom1=new SqlCommand(str1,objSqlConnection);SqlDataReader dr=myOldCom1.ExecuteReader();if(dr.Read()){if(File.Exists (Server.MapPath(""+dr["img"].ToString()))){FileInfo fi=new FileInfo(Server.MapPath(""+dr["img"].ToString()));fi.Delete();}}dr.Close();删除不了图片。。是代码问题吗
2 回答
- 2 回答
- 0 关注
- 1165 浏览
添加回答
举报
0/150
提交
取消