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 回答
- 0 關注
- 1198 瀏覽
添加回答
舉報
0/150
提交
取消