更改重定向URL在谷歌驱动器 - C#(第二部分) [英] Change Redirect Url in Google Drive - C# (Part 2)

查看:171
本文介绍了更改重定向URL在谷歌驱动器 - C#(第二部分)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么,但这个消息是由主持人在我的第一个问题删除,主持人写道,我需要打开新问题。所以......
(第1部分 - <一个href=\"http://stackoverflow.com/questions/27090804/change-google-default-auth-redirection-c-sharp-google-liblary\">Change谷歌默认的认证重定向 - C#(谷歌liblary))

I dont know why, but this Message was deleted by moderator in my First question and moderator wrote that I need open New question. So...... (part 1 - Change Google default Auth Redirection - C# (Google liblary))

我试着坏没有什么问题:如果我试试这个code:

I try bad have little problem: If i try this code:

public class MyNewAuthorizationCodeMvcApp : AuthorizationCodeMvcApp
    {
        public MyNewAuthorizationCodeMvcApp(Controller controller, FlowMetadata flowData) : base(flowData.Flow, "http://www.yandex.ru",  controller.Request.Url.ToString())
        {         


        }
    } 

我得到错误:授权codeMvcApp构造函数(默认liblary)不contein一个构造函数3个参数

I get error that : AuthorizationCodeMvcApp constructor(default liblary) does not contein a constructor that takes 3 arguments

如果我尝试:

  public class MyNewAuthorizationCodeMvcApp : AuthorizationCodeWebApp
    {
        public MyNewAuthorizationCodeMvcApp(Controller controller, FlowMetadata flowData) : base(flowData.Flow, "http://www.yandex.ru",  controller.Request.Url.ToString())
        {         


        }
    }

我不明白的错误,但!我不能SET Valeu为

I dont get error BUT! i cant SET Valeu for

        this.controller = controller;
        this.flowData = flowData;

由于本场仅用于读取(((

Because this field only for reading(((

错了呢?

推荐答案

<一个href=\"https://$c$c.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Auth.Mvc4/OAuth2/Mvc/Authorization$c$cMvcApp.cs?r=eb702f917c0e18fc960d077af132d0d83bcd6a88#43\"相对=nofollow>授权codeMvcApp 有两个参数的构造函数中,所以这就是为什么你得到的第一个错误。

AuthorizationCodeMvcApp Takes two parameters in its constructor, so that's why you get the first error.

因为他们自己在构造函数中只设置只读,在授权codeMvcApp您不能设置控制器和flowdata!

You can't set controller and flowdata because they are read only, in the AuthorizationCodeMvcApp they are set only in the constructor!

我觉得你最好的解决办法是把刚才复制的<一个内容href=\"https://$c$c.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Auth.Mvc4/OAuth2/Mvc/Authorization$c$cMvcApp.cs?r=eb702f917c0e18fc960d077af132d0d83bcd6a88#46\"相对=nofollow>你希望它有授权codeMvcApp 以及变线46到正确的URI。

I think that the best solution for you is to just copy the content of AuthorizationCodeMvcApp and change line 46 to the right URI you want it to have.

这篇关于更改重定向URL在谷歌驱动器 - C#(第二部分)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆