积极答复者
请教一个关于目录字符串分解的简单算法?

问题
答案
-
每个目录都有自己的父目录
通过cte递归查询自己的所有parent,这个比较通用的方法。
不过考虑到效率,建议通过冗余字段来提高效率。
family as water
- 已标记为答案 Bob ShenModerator 2013年6月21日 8:39
-
你可以通过路径字符串来构建一个DirectoryInfo类,然后使用该类的Parent属性来获得目录的父级目录的,然后你在把父级目录存到数据库中就可以了
If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample
- 已建议为答案 DK. Da 2013年6月11日 15:12
- 已标记为答案 Bob ShenModerator 2013年6月21日 8:37
全部回复
-
每个目录都有自己的父目录
通过cte递归查询自己的所有parent,这个比较通用的方法。
不过考虑到效率,建议通过冗余字段来提高效率。
family as water
- 已标记为答案 Bob ShenModerator 2013年6月21日 8:39
-
你可以通过路径字符串来构建一个DirectoryInfo类,然后使用该类的Parent属性来获得目录的父级目录的,然后你在把父级目录存到数据库中就可以了
If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample
- 已建议为答案 DK. Da 2013年6月11日 15:12
- 已标记为答案 Bob ShenModerator 2013年6月21日 8:37