简体   繁体   English

从两台不同的计算机在一个驱动器中打开文件

[英]Opening a File in onedrive from two different computers

I have an app that acceses files in one drive.I can easily create/read the file from the computer that i developed the app. 我有一个可以在一个驱动器中访问文件的应用程序。我可以轻松地从开发该应用程序的计算机上创建/读取文件。 As soon as I test the app in another computer I get this error The file cannot be accessed by the system . 我在另一台计算机上测试该应用程序后,立即收到此错误消息,系统无法访问该文件 Here is the code I'm using: 这是我正在使用的代码:

Stream stream = new FileStream(fpath, FileMode.Open, FileAccess.Read, FileShare.Read);

The interesting part is I can see the file is there by calling on File.Exists(fPath) but I still cannot open it. 有趣的是,我可以通过调用File.Exists(fPath)看到文件在那里,但是我仍然无法打开它。 I appreciate any help. 感谢您的帮助。 Thanks 谢谢

I finally managed to fix it. 我终于设法解决了。 The only thing i have to do is right click on the folder/files in OneDrive and choose "Make available offline" 我唯一要做的就是右键单击OneDrive中的文件夹/文件,然后选择“使脱机可用”

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

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