This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Insert a new permission. | |
/// </summary> | |
/// <param name="service">Drive API service instance.</param> | |
/// <param name="fileId">ID of the file to insert permission for.</param> | |
/// <param name="who"> | |
/// User or group e-mail address, domain name or null for "default" type. | |
/// </param> | |
/// <param name="type">The value "user", "group", "domain" or "default".</param> | |
/// <param name="role">The value "owner", "writer" or "reader".</param> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Google/autoload.php'; | |
session_start(); | |
/************************************************ | |
The following 3 values an befound in the setting | |
for the application you created on Google | |
Developers console. Developers console. | |
The Key file should be placed in a location | |
that is not accessable from the web. outside of | |
web root. web root. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Authenticate to Google Using Oauth2 | |
/// Documentation https://developers.google.com/accounts/docs/OAuth2 | |
/// </summary> | |
/// <param name="clientId">From Google Developer console https://console.developers.google.com</param> | |
/// <param name="clientSecret">From Google Developer console https://console.developers.google.com</param> | |
/// <param name="userName">A string used to identify a user.</param> | |
/// <returns></returns> | |
public static WebmastersService AuthenticateOauth(string clientId, string clientSecret, string userName) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Wix | |
xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
<Product Id="*" Name="Daimto for SSIS (SQL Server 2008)" Language="1033" Version="1.0.0.0" | |
Manufacturer="DAIMTO" UpgradeCode="84543418-55c4-48c0-b5be-2496fb84ffb6"> | |
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" | |
InstallPrivileges="elevated" AdminImage="yes" /> | |
<MediaTemplate EmbedCab="yes" CompressionLevel="high" /> | |
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates the auth url | |
/// https://accounts.google.com/o/oauth2/auth?client_id={clientid}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope={scope}&response_type=code | |
/// client id from google developer console. | |
/// scope comma seproated | |
/// </summary> | |
/// <returns></returns> | |
public static Uri GetAuthURI() | |
{ | |
return new Uri(string.Format("https://accounts.google.com/o/oauth2/auth?client_id={0}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope={1}&response_type=code", Properties.Resources.clientId, Properties.Resources.scope)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TokenResponse | |
{ | |
public string access_token { get; set; } | |
public string token_type { get; set; } | |
public string expires_in { get; set; } | |
public string refresh_token { get; set; } | |
} | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AccessTokenResponse | |
{ | |
public string access_token { get; set; } | |
public string token_type { get; set; } | |
public string expires_in { get; set; } | |
} | |
/// <summary> | |
/// takes a refreshtoken and exchanges it for an accessotken. | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void auth() | |
{ | |
webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(GetTitle); | |
webBrowser1.Navigate(SimpleAuth.GetAuthURI().ToString()); | |
} | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Name: Get | |
/// Description: Gets information about the user, the user's Drive, and system capabilities. | |
/// Documentation: https://developers.google.com/drive/v3/reference | |
/// Service must be authentcated with one of the following scopes: | |
/// DriveService.Scope.Drive: View and manage the files in your Google Drive | |
/// DriveService.Scope.DriveAppdata: View and manage its own configuration data in your Google Drive | |
/// DriveService.Scope.DriveFile: View and manage Google Drive files and folders that you have opened or created with this app | |
/// DriveService.Scope.DriveMetadata: View and manage metadata of files in your Google Drive | |
/// DriveService.Scope.DriveMetadataReadonly: View metadata for files in your Google Drive |