C#如何判断一个文件夹是否存在?

yaoyouyou 2006-04-18 02:14:16
UP_FILE.PostedFile.SaveAs(FilePath);
上传图片,我要先判断一下用于存放图片的文件夹是否已经存在,如果不存在我要创建一个.
如何实现???
...全文
345 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yaoyouyou 2006-04-18
  • 打赏
  • 举报
回复
非常感谢
DianCMS 2006-04-18
  • 打赏
  • 举报
回复
using System.IO;


File.Exists
xiaomatian 2006-04-18
  • 打赏
  • 举报
回复
Directory.Exists()
zyaln 2006-04-18
  • 打赏
  • 举报
回复
System.IO.Directory.Exists()
正解
20011521 2006-04-18
  • 打赏
  • 举报
回复
System.IO.Directory.Exists()
iceblue2005gather 2006-04-18
  • 打赏
  • 举报
回复
楼上的正确,楼主察看一下Directory,和Directoryinfo的msdn的帮助,会很有帮助,会解决你的一系列问题.
combread 2006-04-18
  • 打赏
  • 举报
回复
System.IO.Directory.Exists(xxxxx)
julong88 2006-04-18
  • 打赏
  • 举报
回复
File.Exists
julong88 2006-04-18
  • 打赏
  • 举报
回复
if(!File.Exists("11.txt"))

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧