在凭据处理程序上使用libgit2Sharp github的示例时,我得到了一个错误。(https://github.com/libgit2/libgit2sharp/wiki/git-push <-第一个)
PushOptions opt = new PushOptions();
options.CredentialsProvider = new CredentialsHandler(("url here",
"username", (I don't know the type right now)) => new
UsernameAndPasswordCredentials(){...});我得到了几个错误的标记错误,例如,在两个字符串之后的',‘。有人能帮我吗,或者给我举个推的例子?
发布于 2015-08-03 17:01:08
示例中需要替换的代码的唯一部分是以大写字母表示的USERNAME和PASSWORD。Credentials字段在FetchOptions中是一个回调,如果服务器请求用户凭据,它将由libgit2sharp调用。示例代码使用带lambda语法的内联委托来缩短示例,但如果愿意,可以将回调函数定义为其他地方的方法或函数。
请注意,这个特定的示例假设您提前知道服务器将要求什么样的身份验证,并且您还知道正确的用户名和密码将是什么。
https://stackoverflow.com/questions/31777044
复制相似问题