典型的逻辑错误!
来源:互联网 发布:战网agent mac 编辑:程序博客网 时间:2024/06/10 14:21
string tableNameStr=Request.Params["delTbName"]==null?"":Request.Params["delTbName"];
string id=Request.Params["id"]==null?"":Request.Params["id"];
string IsRecord=Request.Params["RecGuid"]==null?"":Request.Params["RecGuid"];
string sqlDel="";
string[] recGuidAry = getSubRecStr( tableNameStr,IsRecord).Split(',');
if( id!="")
sqlDel="delete from "+tableNameStr+" where id='"+id+"'" ;
string sqlDelSub="";
if( IsRecord !="" )
sqlDelSub ="delete from "+tableNameStr+" where ParentRecGuid ='"+ IsRecord +"'" ;
if( dbP.runSqlCmdText(sqlDelSub)[1] != null )
{
showAlertPageEdit("删除子记录失败。",true,true);
Response.End();
}
if( dbP.runSqlCmdText(sqlDel)[1] != null )
{
showAlertPageEdit("删除记录失败。",true,true);
Response.End();
}
string s=System.Configuration.ConfigurationSettings.AppSettings.Get("attachment");
try
{
if( recGuidAry.Length >1 )
{
for(int i=0;i<recGuidAry.Length;i++ )
{
if( Directory.Exists( Path.Combine(s,"attachment//"+ReGuidStr+"//"+recGuidAry[i]) ) && recGuidAry[i]!="" )
{
Directory.Delete( Path.Combine(s,"attachment//"+ReGuidStr+"//"+recGuidAry[i]),true);
}
}
}
}
catch
{
//showAlertPageEdit("附件删除失败。",true,true);
//Response.End();
}
try
{
if( Directory.Exists( Path.Combine(s,"attachment//"+ReGuidStr+"//"+IsRecord) ) && IsRecord != "" )
{
Directory.Delete( Path.Combine(s,"attachment//"+ReGuidStr+"//"+IsRecord),true);
}
}
catch
{
showAlertPageEdit("附件删除失败。",true,true);
Response.End();
}
showAlertPageEdit("删除成功。",true,true);
上面是我的一个函数中的代码,因为没有加红色的代码,而导致在我的 recGuidAry[i] and IsRecord 的时候我的整个文件夹都被删除了!
- 典型的逻辑错误!
- 典型的段错误
- 一个典型的Struts2错误
- 字符串指针的典型错误
- 调试错误的逻辑
- 一个典型的Quartus II 逻辑项目的实现过程
- 一个典型的事务使用错误分析
- 一个典型的strcpy函数错误
- 典型的局部变量位置错误
- String[] arrayIP= null;的典型错误
- 软件项目管理的典型错误
- 典型数据不同步造成的错误(1)
- 程序员看法上的几个典型错误
- 总结c++内存错误的典型情况
- C关于typedef的两个典型错误!
- C 关于sizeof的典型错误
- 程序员看法上的几个典型错误
- 总结c++内存错误的典型情况 .
- 用67种语言说“我爱你”
- 今天我没有找到方向~
- jar.exe的encode问题
- 缺陷管理的工业标准用语及其含义。
- 关于校园网内最近流行的rose.exe病毒
- 典型的逻辑错误!
- 我没有在自己的行业里边做blog
- 使用Eclipse3.0+lomboz3.0+jboss3.2.3开发EJB
- 关于GridView的无数据显示问题..
- VB编程实现XP风格之终结篇
- java连接数据库准备
- javascript小技巧[转]
- 有趣的JSP测试-你对自己的应用服务器有信心吗?
- QQ全面攻防 拒绝QQ黑客