1 / 17

Google Data API Spreadsheet

Google Data API Spreadsheet. 2012/2/29. Google Spreadsheet. Google Document 中的一類 線上試算表 ( 類似 MS Excel) 亦可以當成線上 DB 來使用 其他使用方式就看使用者自行想像與運用. Spreadsheet 的架構. Spreadsheet1. Spreadsheet2. Document. sheet1. sheet2. sheet3. …. sheet1. sheet2. sheet3. …. 建立一個自己的 Spreadsheet.

Télécharger la présentation

Google Data API Spreadsheet

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Google Data APISpreadsheet 2012/2/29

  2. GoogleSpreadsheet • Google Document中的一類 • 線上試算表(類似MS Excel) • 亦可以當成線上DB來使用 • 其他使用方式就看使用者自行想像與運用

  3. Spreadsheet的架構 Spreadsheet1 Spreadsheet2 Document sheet1 sheet2 sheet3 … sheet1 sheet2 sheet3 …

  4. 建立一個自己的Spreadsheet • 登入Google Document  Create  Spreadsheet

  5. 建立一個Spreadshhet-user user Sheet=userlist

  6. 將user當成用戶資料表來使用 用戶資料表

  7. 利用Google Spreadsheet做帳號密碼控管 • 延續Google_API專案 • Form1表單 TextBox1 TextBox2 Button1 Button2

  8. 修正Button1_Click • 原Google Account認證用來存取Google Document服務 • 使用者的實際帳號密碼在Spreadsheet-user中的userlist • 程式邏輯 • 通過Google Account認證  判斷Spreadsheet-user中的userlist是否有使用者輸入的帳號與密碼

  9. 需要的Google Data API • .NET專案中需要加入三個參考 來源:Google API Library安裝目錄

  10. 修正Button1_Click (I) ' 確認登入 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' 檢查輸入不為空 If Trim(TextBox1.Text) = "" Or Trim(TextBox2.Text) = "" Then MessageBox.Show("請輸入完整的帳號與密碼!") Exit Sub End If ' 開始Google Account確認 Dim objClient As New System.Net.WebClient Dim response As String ' 宣告Gppgle API呼叫變數 ' 透過服務認證 Try objClient.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text) response = System.Text.Encoding.UTF8.GetString(objClient.DownloadData("https://mail.google.com/mail/feed/atom")) MessageBox.Show("認證成功") Catch ex As Exception MessageBox.Show("認證失敗") End Try End Sub 從這裡開始

  11. 修正Button1_Click(II) 修正後

  12. 加入checkSpreadsheet副程式 負責檢查是否有user這個spreadsheet

  13. 加入checkWorksheet副程式 負責檢查是否有userlist這個ssheet

  14. 加入checkList副程式 負責檢查是否有使用者輸入的帳號與密碼

  15. 完整的Spreadsheet範例 • Google Data API SDK  Samples Spreadsheets • Google Data API SDK  Google Data APIs Samples.sln 試試轉成VB.NET

  16. 可改進部份 • 編號:2 • 問題:等待時改變游標辦成沙漏狀,完成後再改回箭頭狀 • 提示:透過System.Windows.Forms.Cursor.Current …

  17. 可改進部份 • 編號:3 • 問題:加入使用者修改自己資料的程式 • 提示:透過Google Data APIs Samples.sln …

More Related