Change Redirect Url in Google Drive - C# (Part 2)

半城伤御伤魂 提交于 2019-12-08 10:01:00

问题


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))

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())
        {         


        }
    } 

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

if I try :

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


        }
    }

I dont get error BUT! i cant SET Valeu for

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

Because this field only for reading(((

What wrong?


回答1:


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

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

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.



来源:https://stackoverflow.com/questions/27104306/change-redirect-url-in-google-drive-c-sharp-part-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!