草庐IT

facebook_access_token

全部标签

c# - 客户端无权使用此方法检索访问 token Gmail API C#

当我尝试使用服务帐户授权gmailapi时出现以下错误"Clientisunauthorizedtoretrieveaccesstokensusingthismethod"staticasyncTaskMainAsync(){sstageEntitiesdb=newsstageEntities();//UserCredentialcredential;Dictionarydictionary=newDictionary();StringserviceAccountEmail="xxx.iam.gserviceaccount.com";varcertificate=newX509Cert

c# - 集成 Facebook 聊天

我已经用C#编写了一个程序来集成Facebook用户聊天,但是我总是得到将响应发送到服务器后。我已经检查了APIkey和应用程序key,它们都是正确的。看起来我向服务器传递了一些错误的参数。这是我的代码。privatevoidGetDetailsButton_Click(objectsender,EventArgse){TcpClientFacebookClient=newTcpClient();FacebookClient.Connect("chat.facebook.com",5222);NetworkStreammyns=FacebookClient.GetStream();st

c# - 发送不记名 token 时 API 端点返回 "Authorization has been denied for this request."

我按照教程在C#中使用OAuth保护WebAPI。我正在做一些测试,到目前为止,我已经能够从/token成功获取访问token。我正在使用名为“AdvancedRESTClient”的Chrome扩展来测试它。{"access_token":"...","token_type":"bearer","expires_in":86399}这是我从/token得到的。一切看起来都很好。我的下一个请求是我的测试APIController:namespaceAPI.Controllers{[Authorize][RoutePrefix("api/Social")]publicclassSocia

c# - 为什么我在 WPF 用户控件上看到 "member is not recognized or is not accessible"错误?

我有一个带有公共(public)属性的自定义用户控件,我希望能够在XAML中进行设置。在下面。TestControl.xamlTestControl.xaml.csusingSystem.Windows.Controls;namespaceMyProject.Controls{publicpartialclassTestControl:UserControl{publicstringTestMe{get;set;}publicTestControl(){InitializeComponent();}}}然后,在我的MainWindow.xaml文件中,我尝试包含以下内容:但是,即使Vi

c# - 如何以编程方式在 C# 中创建 Microsoft Access 数据库?

如果MicrosoftAccess数据库文件不存在,如何在C#中创建它? 最佳答案 最简单的答案是在您的程序中嵌入一个空的.mdb/.accdb文件并将其写入磁盘。正确答案是将COMInterop与ADOX库一起使用:varcat=newADOX.Catalog()cat.Create(connectionString);请记住使用OleDbConnectionStringBuilder生成连接字符串。 关于c#-如何以编程方式在C#中创建MicrosoftAccess数据库?,我们在S

c# - WPF 调度程序 {"The calling thread cannot access this object because a different thread owns it."}

首先我需要说我是WPF和C#的菜鸟。应用程序:创建Mandelbrot图像(GUI)在这种情况下,我的调度员工作得很好:privatevoidprogressBarRefresh(){while((con.Progress)尝试使用以下代码执行此操作时,我收到了消息(标题):bmp=BitmapSource.Create(width,height,96,96,pf,null,rawImage,stride);this.Dispatcher.Invoke(DispatcherPriority.Send,newAction(delegate{img.Source=bmp;ViewBox.C

c# - LINQ to Entities Group By 表达式给出 'Anonymous type projection initializer should be simple name or member access expression'

我在这个表达式中遇到了上述错误:varaggregate=fromtinentities.TraceLinesjoinminentities.MethodNames.Where("it.NameLIKE@searchTerm",newObjectParameter("searchTerm",searchTerm))ont.MethodHashequalsm.MethodHashwhere(t.CallTypeId&(int)types)==t.CallTypeId&&t.UserSessionProcessId==m_SessionIdgrouptbym.Nameintodselect

c# - T4代码生成: access types in current project

使用T4代码生成,是否可以访问当前项目中定义的类型?例如,如果我有一个接口(interface)并且我想将它的实现委托(delegate)给另一个类,即interfaceIDoSomething{publicvoiddo_something();}classDoSomethingImpl:IDoSomething{publicvoiddo_something(){//implementation...}}classSomeClass:IDoSomething{IDoSomethingm_doSomething=newDoSomethingImpl();//forwardcallstoi

c# - 使用 C# SDK 的 Facebook Like 功能

我想显示以了解何时单击facebook点赞按钮,并在单击验证按钮时将点赞发布到粉丝页面。我想使用FacebookC#SDK。这是我的代码:HTMLYourWebsiteTitleVerify(function(d,s,id){varjs,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";fjs.parent

c# - 通过提供代理 token 处理来自 webapi 的长承载 token

我正在使用声明身份验证使用ASP.NETWebApi2构建WebAPI,我的用户可以拥有大量声明。由于存在大量声明,不记名token会迅速增长,因此我试图找到一种方法来返回更短的不记名token。到目前为止,我发现我可以提供IAuthenticationTokenProvider到OAuth选项OAuthAuthorizationServerOptions.AccessTokenProvider属性:OAuthOptions=newOAuthAuthorizationServerOptions{TokenEndpointPath=newPathString("/Token"),Prov