我需要将下面代码片段中的第 4 行翻译成 VB。由于某种原因,我今晚无法完成这项工作。我要么太累,要么脑筋急转弯……你能帮忙吗?
var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description);
provider.ClientIdentifier = ClientCredentials.ClientID;
provider.ClientSecret = ClientCredentials.ClientSecret;
var auth = new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthentication);
翻译工具让我走到了这一步,但这是不对的。
Dim provider As NativeApplicationClient = New NativeApplicationClient(GoogleAuthenticationServer.Description)
provider.ClientIdentifier = ClientCredentials.ClientID
provider.ClientSecret = ClientCredentials.ClientSecret
Dim auth As OAuth2Authenticator(Of NativeApplicationClient) = New OAuth2Authenticator(Of NativeApplicationClient)(provider, GetAuthorization)
GetAuthorization 方法具有以下签名。
Private Function GetAuthorization(ByVal arg As NativeApplicationClient) As IAuthorizationState