我正在Jenkins服务器上托管一个项目.该项目有一个GitHub仓库,我设置它,所以它自动建立新的提交.为了使其工作,我需要输入一个github帐户的凭据,该帐户具有对repo的完全访问权限.
问题是,如果我想让他将他的登录信息添加到凭证列表,我必须让他访问服务器上的所有凭据(我不希望这样).
我尝试使用"{username}">"Credentials"下的凭据,但这些凭据未显示在项目设置中(即使100%访问服务器上的所有内容).
有没有办法让用户存储他的凭据并将其用于项目而不让他完全访问服务器上的所有凭据?
我有一些代码删除一个文件,另一个(所以我可以覆盖它)并写上它.
My.Computer.FileSystem.DeleteFile("./pass")
File.Create("./pass")
My.Computer.FileSystem.WriteAllText("./pass", MaskedTextBox1.Text, True)
Run Code Online (Sandbox Code Playgroud)
当它写出文字时,它说:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file '[path]\pass' because it is being used by another process.
Run Code Online (Sandbox Code Playgroud)
有没有办法解决这个问题,或者可能只是覆盖文件而不删除并重新创建文件?