简体   繁体   中英

How to get a file content or download it through SharpSVN

I'am using SharpSvn to connect to an SVN server . I would like to get the content of a file or to copy it my disk just by using it Uri on the server. Does SharpSVN API offers this functionality. if it is, how ? thanks.

example of Uri : https://svn.myproject.com/svn/Projet/file.pdf

See How to checkout a specific file in repository using sharpsvn API?

Uri from = new Uri("https://svn.myproject.com/svn/Projet/file.pdf");

using (SvnClient client = new SvnClient())
{
    using (var fs = File.Create(Path.GetFileName(from.LocalPath))) {
        client.Write(SvnTarget.FromUri(from), fs);
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM