當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。