问题
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