新浪微博如何通过获取的  oauth_token  oauth_token_secret 发送微博信息
如:
oauth_token=a593cf5e531efd1219fbca9b0a62f654&oauth_token_secret=d3f69686b4446f19f348cc0503b90958&user_id=2155022943

解决方案 »

  1.   

    看看新浪API吧,,有.net的SDK下载,可以参考,基本就是你先发送一个请求过去,新浪给你返回一个token,然后你把token处理再返回给新浪,就通信上了,然后调用它的发送微博api补齐参数,就能发送了
      

  2.   

    protected void Page_Load(object sender, EventArgs e)
        {
           
            string username = "[email protected]";
            string password = "000000";
            string usernamePassword = username + ":" + password;        //准备调用的URL及需要POST的数据:        string url = "http://api.t.sina.com.cn/statuses/update.xml?source=" + ConfigurationManager.AppSettings["WB_AKEY"];
            string content = "新的一天新的开始!";
            string data ="status=" + content;
           
            //准备用于发起请求的HttpWebRequest对象
            WebRequest webRequest = WebRequest.Create(url);
            HttpWebRequest httpRequest = webRequest as HttpWebRequest;
            //准备用于用户验证的凭据
            CredentialCache myCache = new CredentialCache();
            myCache.Add(new Uri(url), "Basic", new NetworkCredential(username, password));
            httpRequest.Credentials = myCache;
            httpRequest.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new System.Text.ASCIIEncoding().GetBytes(usernamePassword)));
            //发起POST请求
            httpRequest.Method = "POST";
            httpRequest.ContentType = "application/x-www-form-urlencoded";
            System.Text.Encoding encoding = System.Text.Encoding.ASCII;
            byte[] bytesToPost = encoding.GetBytes(data);
            httpRequest.ContentLength = bytesToPost.Length;        Stream requestStream = httpRequest.GetRequestStream();
            requestStream.Write(bytesToPost, 0, bytesToPost.Length);
            requestStream.Close();
            string responseContent = "";
            try
            {
                //获取服务端的响应内容
                WebResponse wr = httpRequest.GetResponse();
                Stream receiveStream = wr.GetResponseStream();
                
                using (StreamReader reader = new StreamReader(receiveStream, System.Text.Encoding.UTF8))
                {
                    responseContent = reader.ReadToEnd();
                }
            }
            catch (Exception ex)
            {
                responseContent = ex.Message;
            }
            Response.Write(responseContent);
        }
      

  3.   


    问题是,我用新浪的账号登陆时,先到新浪登陆,然后新浪跳到我的站点来,我怎么用
    获取到的oauth_token oauth_token_secret 发送微博信息
      

  4.   

    vv
    问题是,我用新浪的账号登陆时,先到新浪登陆,然后新浪跳到我的站点来,我怎么用
    获取到的oauth_token oauth_token_secret 发送微
      

  5.   

    我用我的帐号和key 怎么报“远程服务器返回错误: (400) 错误的请求。”