当前位置: 首页>>代码示例>>C#>>正文


C# TwitterService.BeginSendTweet方法代码示例

本文整理汇总了C#中TweetSharp.TwitterService.BeginSendTweet方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterService.BeginSendTweet方法的具体用法?C# TwitterService.BeginSendTweet怎么用?C# TwitterService.BeginSendTweet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TweetSharp.TwitterService的用法示例。


在下文中一共展示了TwitterService.BeginSendTweet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteRando

        private Response WriteRando()
        {
            Guid password = Request.Form.password;
            var consumerKey = ConfigurationManager.AppSettings["consumerKey"];
            var consumerSecret = ConfigurationManager.AppSettings["consumerSecret"];
            var token = ConfigurationManager.AppSettings["token"];
            var tokenSecret = ConfigurationManager.AppSettings["tokenSecret"];
            //require a password so people don't just randomly spam this endpoint
            if (password == new Guid(ConfigurationManager.AppSettings["password"]))
            {
                var rando = Rando.Console.Program.GenerateRando(System.Web.HttpContext.Current.Server.MapPath("~"));
                var service = new TwitterService(consumerKey, consumerSecret, token, tokenSecret);

                service.BeginSendTweet(new SendTweetOptions {Status = rando});
            }
            return new Response() { StatusCode = HttpStatusCode.OK };
        }
开发者ID:ChadMcCallum,项目名称:AzureRando,代码行数:17,代码来源:RandoModule.cs

示例2: btnAdd_Click

        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!editMode)
            {
                TwitterService service = new TwitterService("9fHcTGpQkdy25gAQ8bFmiOd67", "KBWAa7reZWDEofMkgDluIfLVk9dEaAZAOTinUFInw5k6xNGCX6");

                // Step 1 - Retrieve an OAuth Request Token
                OAuthRequestToken requestToken = service.GetRequestToken();

                // Step 2 - Redirect to the OAuth Authorization URL
                Uri uri = service.GetAuthorizationUri(requestToken);
                Process.Start(uri.ToString());

                // Step 3 - Exchange the Request Token for an Access Token
                string verifier = "0350060"; // <-- This is input into your application by your user
                OAuthAccessToken access = service.GetAccessToken(requestToken, verifier);

                // Step 4 - User authenticates using the Access Token
                service.AuthenticateWith(access.Token, access.TokenSecret);

                var aluno = new Aluno((Turma)Enum.Parse(typeof(Turma), cbxTurma.Text),
                        txtNome.Text,
                        txtSobrenome.Text,
                        int.Parse(txtIdade.Text),
                        double.Parse(txtNota.Text),
                        (Status)Enum.Parse(typeof(Status), cbxStatus.Text));
                _alunoAplicacao.Adicionar(aluno);

                service.BeginSendTweet(new SendTweetOptions());
            }

            else
            {
                var aluno = _alunoAplicacao.Buscar(_aluno.Id);
                aluno.Turma = (Turma)Enum.Parse(typeof(Turma), cbxTurma.Text);
                aluno.Nome = txtNome.Text;
                aluno.Sobrenome = txtSobrenome.Text;
                aluno.Idade = int.Parse(txtIdade.Text);
                aluno.Nota = double.Parse(txtNota.Text);
                aluno.Status = (Status)Enum.Parse(typeof(Status), cbxStatus.Text);
                _alunoAplicacao.Atualizar(aluno);
            }
            Close();
        }
开发者ID:CamilaRocha,项目名称:SIDiarioEscolar,代码行数:44,代码来源:FormAddAluno.cs


注:本文中的TweetSharp.TwitterService.BeginSendTweet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。