请选择 进入手机版 | 继续访问电脑版

Hello Mat

 找回密码
 立即注册
查看: 4283|回复: 1

文件(夹)是否存在

[复制链接]

1288

主题

1514

帖子

90

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22589
发表于 2020-12-6 13:12:17 | 显示全部楼层 |阅读模式
文件夹是否存在
  1.             if (System.IO.Directory.Exists(iniFile))
  2.             {
  3.                 GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, returnString, 1024, iniFile);
  4.             }
复制代码
  1. if (System.IO.Directory.Exists(Server.MapPath("file")) ) //如果不存在就创建file文件夹
  2. {
  3.   System.IO.Directory.CreateDirectory(Server.MapPath("file"));
  4. }
复制代码
文件是否存在
  1.             if (File.Exists(iniFile))
  2.             {
  3.                 long res = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, returnString, 1024, iniFile);
  4.             }
复制代码





算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-3-29 18:59 , Processed in 0.224267 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表