How to programatically do file versioning with SVN and .NET?

后端 未结 4 1947
无人共我
无人共我 2021-02-06 05:59

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

4条回答
  •  失恋的感觉
    2021-02-06 06:32

    You should take a look at the SharpSvn .NET library. You will probably need checkout and commit commands:

    Checking out:

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

    Committing:

    string wcPath = "c:\\my working copy";
    SvnCommitArgs a = new SvnCommitArgs();
    a.LogMessage = "My log message";
    
    using (SvnClient client = new SvnClient())
    {
        client.Commit(wcPath, a);
    }
    

提交回复
热议问题