如何使用 SVN 和 .NET 以编程方式进行文件版本控制? [英] How to programatically do file versioning with SVN and .NET?
本文介绍了如何使用 SVN 和 .NET 以编程方式进行文件版本控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们有一个报告生成器.每天,它会将数据写入 excel 文件.
We have a report generator. Daily, it writes its data into a excel file.
出于版本控制和文件数据安全的原因,我们需要更改此文件,并将更改提交到存储库中.
For reasons of version controlling and file data safety, we need to alter this file, and commit the changes into a repository.
您是否推荐您使用过的任何 .net SVN API?
Do you recommend any .net SVN API you've used?
推荐答案
你应该看看 SharpSvn .NET 库.您可能需要 checkout 和 commit 命令:
You should take a look at the SharpSvn .NET library. You will probably need checkout and commit commands:
签出:
string wcPath = "c:\\my working copy";
using (SvnClient client = new SvnClient())
{
client.CheckOut(new Uri("http://server/path/to/repos"), wcPath);
}
承诺:
string wcPath = "c:\\my working copy";
SvnCommitArgs a = new SvnCommitArgs();
a.LogMessage = "My log message";
using (SvnClient client = new SvnClient())
{
client.Commit(wcPath, a);
}
这篇关于如何使用 SVN 和 .NET 以编程方式进行文件版本控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文