TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bineeshcp Viswanath
NA
140
39.8k
Error in connection to Google API asp.net C#.
Apr 24 2019 8:03 AM
Dear All,
I am getting a error while connecting my web application to google drive. This my C# code to connect
I have created a project in google drive. Then Copied the
OAuth 2.0 client IDs.
Then I copied the file into my D drive and given path in web application.
I have marked the error line in red color.
public static DriveService GetService()
{
UserCredential credential;
using (var stream = new FileStream(@"D:\client_secret.json", FileMode.Open, FileAccess.Read))
{
String FolderPath = @"D:\";
String FilePath = Path.Combine(FolderPath, "DriveServiceCredentials.json");
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets, Scopes, "bineesh", CancellationToken.None, new FileDataStore(FilePath, true)).Result;
}
//Create Drive API service.
DriveService service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "GoogleDriveRestAPI-v3",
});
return service;
}
I have attached the error screenshot with this. Please find it and let me know how i can solve this issue.
Attachment:
gdrive_error.rar
Reply
Answers (
1
)
Regarding Angular 5 and ASP .Net MVC.
How to Retrieve files from Google drive API to website