如何在没有API的情况下找到OneDrive(SkyDrive)和GoogleDrive文件夹? [英] How do I find the OneDrive (SkyDrive) and GoogleDrive folders without the API?

查看:313
本文介绍了如何在没有API的情况下找到OneDrive(SkyDrive)和GoogleDrive文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢这篇文章,

如何以编程方式找到使用C#的Dropbox文件夹?



我可以通过编程的方式找到Dropbox文件夹。现在,在没有安装和使用各种AP​​I的情况下,GoogleDrive和MS SkyDrive应如何实现?



Vb.Net或C#解决方案都可以...

解决方案

我在这里找到了答案的一部分...


$ b

如何以编程方式找到使用C#的Google云端硬盘文件夹?

这是我的三个主要Webfolder服务的代码

  Dim StoreFolder As String =
'Dropbox
Dim dbPath As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),Dropbox \\ host.db)
Dim lines()As String = System.IO.File.ReadAllLines(dbPath)
Dim dbBase64Text As Byte()= Convert.FromBase64String(lines(1))
StoreFolder = System.Text.ASCIIEncoding.ASCII.GetString(dbBase64Text)

'SkyDrive
StoreFolder = My.Computer.Registry.GetValue(HKEY_CURRENT_USER\Software\Microsoft\SkyDrive,UserFolder,Nothing)

'Google Drive
Dim dbPath As String = Path.Combine (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),Google\\Drive\\\sync_config.db)
File.Copy(dbPath,temp.db,True)
StoreFolder = File.ReadAllText(temp.db,System.Text.Encoding.ASCII)
StoreFolder = StoreFolder.Substring(StoreFolder.IndexOf(local_sync_root_pathvalue)+ 29)
StoreFolder = StoreFolder.Substring (0,StoreFolder.IndexOf(Char.ConvertFromUtf32(24)))


Thanks to this article,

How do I programmatically locate my Dropbox folder using C#?

I can programmtically find the Dropbox folder. Now, without installing and using various APIs, how can I do the same for GoogleDrive and MS SkyDrive?

Vb.Net or C# solutions are OK...

解决方案

I found part of the answer here...

How do I programmatically locate my Google Drive folder using C#?

Here is my code for three of the main Webfolder services

Dim StoreFolder As String = ""
' Dropbox
Dim dbPath As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Dropbox\\host.db")
Dim lines() As String = System.IO.File.ReadAllLines(dbPath)
Dim dbBase64Text As Byte() = Convert.FromBase64String(lines(1))
StoreFolder = System.Text.ASCIIEncoding.ASCII.GetString(dbBase64Text)

' SkyDrive
StoreFolder = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\SkyDrive", "UserFolder", Nothing)

' Google Drive
Dim dbPath As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Google\\Drive\\sync_config.db")
File.Copy(dbPath, "temp.db", True)
StoreFolder = File.ReadAllText("temp.db", System.Text.Encoding.ASCII)
StoreFolder = StoreFolder.Substring(StoreFolder.IndexOf("local_sync_root_pathvalue") + 29)
StoreFolder = StoreFolder.Substring(0, StoreFolder.IndexOf(Char.ConvertFromUtf32(24)))

这篇关于如何在没有API的情况下找到OneDrive(SkyDrive)和GoogleDrive文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆