递归调用的错误,高手过来看看!谢谢了,十万火急~!

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

一运行网站,就会报  
  “发生类型为   system.stackoverflowexception   的异常。   ”  
  ----------------------------------  
   
  //生成以当前时间为名字的目录,并且返回目录地址;  
  public   string   createdirectory()  
  {  
  string   path=httpcontext.current.request.physicalapplicationpath+@"articles\data\";//整个程序的物理路径加上+"articles\data\"  
  path=path+datetime.now.year.tostring();  
  if   (directory.exists(path))  
  {  
  path=path+"\\"+datetime.now.month.tostring();  
  if   (directory.exists(path))  
  {  
  return   path+"\\";  
  }  
  else  
  {  
  directory.createdirectory(path);  
  return   path+"\\";  
  }  
  }  
  else  
  {  
  directory.createdirectory(path);  
  createdirectory();//递归调用用来检查月份目录是否生成  
  return   path+"\\";  
  }  
  }

.

· 网友精彩回答:

处理 SSI 文件时出错
© 2006-2008 All Rights Reserved