2014-01-27 5 views

답변

2

필요한 정보를 추출하기 위해이 코드를 발견했습니다. 나는 혜택을 누릴 수 있습니다 경우 사람이 그것을 게시하도록하겠습니다. SQLite를 사용하여 sync_config.db 파일에서 정보를 추출합니다.

String dbFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Google\\Drive\\sync_config.db"); 

string csGdrive = @"Data Source=" + dbFilePath + ";Version=3;New=False;Compress=True;"; 

     try { 
      using (var con = new SQLiteConnection(csGdrive)) { 
       con.Open(); 
       using (var sqLitecmd = new SQLiteCommand(con)) { 
        //To retrieve the folder use the following command text 
        sqLitecmd.CommandText = "select * from data where entry_key='local_sync_root_path'"; 

        using (var reader = sqLitecmd.ExecuteReader()) { 
         reader.Read(); 
         //String retrieved is in the format "\\?\<path>" that's why I have used Substring function to extract the path alone. 
         destFolder = reader["data_value"].ToString().Substring(4); 
         Console.WriteLine("Google Drive Folder: " + destFolder); 
        } 
       } 
      } 
     } 
0

Google 드라이브에 대한 링크는 https://drive.google.com/#my-drive입니다. 하지만 웹 브라우저 컨트롤에서 열어야하고, 애플리케이션이 설치되어있는 컴퓨터에서 누가 Google에 로그인했는지 자동으로 열어야합니다.

당신은 구글 드라이브 SDK를 사용하도록해야 할 것 다음 WebBrowser 컨트롤, 매우 유용한에서 엽니 다 싶지 않는 경우.

의 루트 디렉토리의 이름은 내가 Google 드라이브 Windows and Mac에 대한 응용 프로그램을 설치에 대해 이야기하는, 제대로 이해하면 단순히 root

1

입니다.

는 로컬 컴퓨터가 아닌 사용자의 Google 계정에 고유로 사용자가 로컬 컴퓨터에 자신의 드라이브 폴더를 배치 위치를 확인 할 API가 없습니다. Windows에서

은, SQLite는 3 데이터베이스의 드라이브 앱 스토어의 로컬 드라이브 경로에 위치 :

%LOCALAPPDATA%\Google\Drive\sync_config.db

이 맥 앱이 사용자의에 위치한 비슷한 이름 SQLite 데이터베이스 파일을 사용하는 가정 안전 홈 디렉토리.

+0

내 컴퓨터에서 폴더는 'C : \ Users \ p620327 \ AppData \ Local \ Google \ Drive \ user_default'입니다. 어쩌면 그것은 구글에 의해 어느 시점에서 변경되었을 것입니다. – Berend

관련 문제