如何使用SVN和.NET以编程方式进行文件版本控制?

Vic*_*ues 8 .net c# svn api c#-3.0

我们有一个报告生成器.每日,它将其数据写入excel文件.

出于版本控制和文件数据安全的原因,我们需要更改此文件,并将更改提交到存储库.

您推荐使用过任何.net SVN API吗?

San*_*ken 11

您应该看一下SharpSvn .NET库.您可能需要checkout和commit命令:

退房:

string wcPath = "c:\\my working copy";
using (SvnClient client = new SvnClient())
{
    client.CheckOut(new Uri("http://server/path/to/repos"), wcPath);
}
Run Code Online (Sandbox Code Playgroud)

承诺:

string wcPath = "c:\\my working copy";
SvnCommitArgs a = new SvnCommitArgs();
a.LogMessage = "My log message";

using (SvnClient client = new SvnClient())
{
    client.Commit(wcPath, a);
}
Run Code Online (Sandbox Code Playgroud)