简体   繁体   English

Box.com无人值守控制台应用程序

[英]Box.com Unattended Console Application

I would like to write a synchronization job to move files out into my Box account. 我想编写一个同步作业,将文件移到Box帐户中。 This is a nightly job that will run unattended (C# console app). 这是一项夜间工作,将在无人值守的情况下运行(C#控制台应用程序)。 The OAuth method appears to require user interaction. OAuth方法似乎需要用户交互。

Has anyone done this or have a sample? 有没有人做过或有样品?

I had a similar issue and had to search around for a while in order to find anything at all. 我遇到了类似的问题,必须四处搜寻才能找到所有内容。 Basically the answer seems to be that Box currently only offers the OAuth 2 option and provides no real way to fully automate the process. 基本上,答案似乎是Box当前仅提供OAuth 2选项,并且没有提供完全自动化该过程的真正方法。 However I did find a solution here offered by Vishal Sharma that seems to work. 但是,我确实在这里找到了Vishal Sharma提供的解决方案该解决方案似乎有效。 The gist of it is that you do the manual login once while you're developing, get the code and refresh token, and then set up a cron job to get a new refresh token at most every 60 days before it expires to just keep that connection open. 要点是,在开发过程中,您必须进行一次手动登录,获取代码并刷新令牌,然后设置cron作业以在过期之前最多每60天获取一个新的刷新令牌,以保持该状态。连接打开。 While not graceful, it does give you a fully automated solution until Box decides to come up with a better solution to save us all some time. 尽管不尽人意,但它确实为您提供了一个完全自动化的解决方案,直到Box决定提出一个更好的解决方案来节省我们所有的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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