首页 新闻 会员 周边

An unhandled exception 。。有关文件夹中含有日期格式 asp.net

0
悬赏园豆:20 [已解决问题] 解决于 2012-06-19 11:17

上传后后的文件命名为:"createdocument-admin_2012\06\19.文件后缀".

如:CreateDocument-Admin-6\15\2012_134.html。

调试的时候报:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

有人遇到过吗?

青 草 香的主页 青 草 香 | 初学一级 | 园豆:5
提问于:2012-06-19 10:13
< >
分享
最佳答案
0

regarding the origin and location of the exception can be identified using the exception stack trace below.

 

找出原始的异常信息看。

从你的说明看,应该是路径CreateDocument-Admin-6\15\不存在,此时,应该先判断下路径是否存在,不存在则先创建路径再创建文件。

或者你把文件名中的\替换为-

收获园豆:20
无之无 | 大侠五级 |园豆:5095 | 2012-06-19 10:22

谢谢,替换为空了,CreateDocument-Admin-6152012_134.html,ok了

青 草 香 | 园豆:5 (初学一级) | 2012-06-19 11:16

@青 草 香: 

把“月日年”用MMDDYYYY的格式吧,否则。。。可能会有文件名冲突。

无之无 | 园豆:5095 (大侠五级) | 2012-06-19 11:19
其他回答(1)
1

系统不允许建立这样名称的文件,修改下格式就行了,例如:*****_2012_06_19.文件后缀

webaspx | 园豆:1973 (小虾三级) | 2012-06-19 10:25

嗯,这个地方我也发现了,只是觉得吧,把CreateDocument-Admin-6\15\2012_134.html一放到文件名里面,它就自动消除了。呵呵,也非常谢谢你。

支持(0) 反对(0) 青 草 香 | 园豆:5 (初学一级) | 2012-06-19 11:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册