转载请注明原文出自:http://blog.csdn.net/lizhiliang06/article/details/8667073,里面有更多精彩文章
Google最近推出了云端存储的web API,并且提供了Demo,想做相关方面开发的程序猿有福了,
我们可以从google 提供的地址:https://developers.google.com/drive/examples/ 上下载何种语言的Demo source code,
里面也有每种demo的开发指导,
这里也讲解一下我的操作过程,还有得到的实际效果,
下面基本上用图来说明讲解,这样会简单明了,
(1)首先要有个Google账号
(2)Google API地址https://code.google.com/apis/console/#project:553547969563
(3)进入api选择services
(4)点击API Access,配置各项如下图
(5)进入Driver SDK配置如下图
(6).NETdemo配置代码
namespace DrEdit.Models
{
internal static class ClientCredentials
{
/// <summary>
/// The
OAuth2.0 Client ID of your project.
/// </summary>
public static readonly string CLIENT_ID
= "xxxxxx.apps.googleusercontent.com" ; //"[[YOUR_CLIENT_ID]]";
/// <summary>
/// The
OAuth2.0 Client secret of your project.
/// </summary>
public static readonly string CLIENT_SECRET
= "xxxxxx" ; //"[[YOUR_CLIENT_SECRET]]";
/// <summary>
/// The
OAuth2.0 scopes required by your project.
/// </summary>
public static readonly string[]
SCOPES = new String[]
{
"https://www.googleapis.com/auth/drive.file" ,
"https://www.googleapis.com/auth/userinfo.email" ,
"https://www.googleapis.com/auth/userinfo.profile" ,
"https://www.googleapis.com/auth/drive.install"
};
/// <summary>
/// The
Redirect URI of your project.
/// </summary>
public static readonly string REDIRECT_URI
= "http://127.0.0.1" ; //"[[YOUR_REDIRECT_URI]]";
}
}
到这里已经是运行demo成功了.
转载请注明原文出自:http://blog.csdn.net/lizhiliang06/article/details/8667073,里面有更多精彩文章