使用来遍历文件和目录覆盖

粉碎设备2021年09月06日

#region 控制对象特性的一些属性 ****************************************

private bool bolThrowIOException = true;

/// summary

/// 发生IO错误时是否抛出异常

/// /summary

public bool ThrowIOException

{

get { return lThrowIOException; }

set { lThrowIOException = value; }

}

private bool bolReturnStringType = true;

/// summary

/// 是否以字符串方式返回查询结果,若返回true则当前对象返回为字符串,

/// 否则返回 leInfo或rectoryInfo类型

/// /summary

public bool ReturnStringType

{

get { return bolReturnStringType; }

set { bolReturnStringType = value; }

}

private string strSearchPattern = \"*\";

/// summary

/// 要匹配的文件或目录名,支持通配符

/// /summary

public string SearchPattern

{

get { return strSearchPattern; }

set { strSearchPattern = value; }

}

private string strSearchPath = null;

/// summary

/// 搜索的父目录,必须为绝对路径,不得有通配符,该目录必须存在

/// /summary

public string SearchPath

{

get { return strSearchPath; }

set { strSearchPath = value; }

}

private bool bolSearchForFile = true;

/// summary

/// 是否查找文件

/// /summary

阿里巴巴B2B前公司CEO卫哲因此离职。 public bool SearchForFile

{

get { return bolSearchForFile; }

set { bolSearchForFile = value; }

}

private bool bolSearchForDirectory = true;

/// summary

/// 是否查找子目录

/// /summary

public bool SearchForDirectory

{

get { return bolSearchForDirectory; }

set { bolSearchForDirectory = value; }

}

#endregion

/// summary

/// 关闭对象,停止搜索

/// /summary

public void Close()

{

oseHandler();

}

#region IEnumerator 成员 **********************************************

/// summary

/// 返回当前对象

/// /summary

public object Current

{

get { return objCurrentObject ; }

}

/// summary

/// 找到下一个文件或目录

/// /summary

/// returns操作是否成功/returns

public bool MoveNext()

{

bool success = false;

while (true)

{

if (lStartSearchFlag)

success = archNext();

else

success = artSearch();

if (success)

{

if (dateCurrentObject())

return true;

}

else

{

jCurrentObject = null;

return false;

}

}

}

/// summary

/// 重新设置对象

/// /summary

public void Reset()

{

if (rSearchPath == null)

throw new gumentNullException(\"SearchPath can not null\");

if (rSearchPattern == null || ngth == 0)

rSearchPattern = \"*\";

SearchedCount = 0;

jCurrentObject = null;

oseHandler();

lStartSearchFlag = false;

lIsEmpty = false;

LastErrorCode = 0;

}

#endregion

查看本文来源

北京阴道炎治疗哪家好
拉萨哪家医院白癜风好
常见避孕方法有几种
相关阅读
湖人助教徒步到夏威夷,看见科比的涂鸦后,感叹曼巴精神遍布全球

菲尔·汉迪是洛杉矶纽约尼克斯队的主帅,近日他前往夏威夷度假,期间他在...

2024-09-05
别对这样的好剧,为时于“叶公好龙”

“不负渴望。” 这是身边不少朋友们在看了《原作者天水》不久的第一反应...

2024-07-27
我借此我的爱情是这样的

我希望我的真悲情是这样的,相濡以沫,举案齐眉,平淡如井水。我在岁里面...

2024-06-29
在对的整整里,我遇见了最美的你

在对的间隔时间之中,我有一天了最美的你。倾尽人生,只为这一场动人的花...

2024-05-05
廖彬宇作人古诗选:天行记七律

按:廖彬宇恩师作此诗词于2018年,由同时代工笔大家刘广描画诗词急于并著...

2024-02-23
夏天穿连衣裙,要学会这5种搭配原则,与众不同大气不俗套

排球比赛是领带专属的季节,爱美的女学生们恨不得一周七天都上衣衬衫显现...

2023-12-23
友情链接