SharpSvn:获取库结构和单独的文件

编程入门 行业动态 更新时间:2024-10-19 18:20:27
本文介绍了SharpSvn:获取库结构和单独的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想建立一个简单的库浏览器到Web应用程序,并一直在寻找到使用SharpSvn帮助。

I am trying to build a simple repository browser into a web application and have been looking into using SharpSvn to help.

我能找到的所有常用的物理命令,像更新,提交,这实际上更改了存储库或一个工作拷贝,但我在努力找到一种方法来查询信息库的结构或内容。

I can find all the usual physical commands, like update, commit, that would actually make changes to the repository or a working copy but am struggling to find a way to query a repositories structure or contents.

有什么这样我可以读取存储库的结构,所以我可以在一个网页上显示一个简单的资源管理器一样的界面(即目录树视图以及文件的列表)?

Is there any way I can read the structure of the repository so I can display a simple explorer like interface in a web page (i.e. tree view of directories plus a list of files)?

推荐答案

的 SharpSvn.SvnClient 类有一个的的GetList()函数作品真的很好:使用

The SharpSvn.SvnClient class has a GetList() function that works really well:

using (SvnClient svnClient = new SvnClient()) { Collection<SvnListEventArgs> contents; List<string> files = new List<string>(); if (svnClient.GetList(new Uri(svnUrl), out contents)) { foreach(SvnListEventArgs item in contents) { files.Add(item.Path); } } }

一旦你的收藏,可以在该位置获得每一个项目的路径。您还可以使用Entry对象来获取有关每个项目的信息,包括是否是一个目录或文件,当它最后一次修改,等等。

Once you have the collection, you can get the path of each item at the location. You can also use the Entry object to get information concerning each item, including whether it is a directory or a file, when it was last modified, etc.

更多推荐

SharpSvn:获取库结构和单独的文件

本文发布于:2023-10-16 16:32:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498110.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:结构   文件   SharpSvn

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!