Click here to Skip to main content
15,889,429 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI Thanks for the immediate reply..

As you have asked , i have given mypost message, my username and paswword ,

Following is the code i am using

Sub TwitIt(ByVal strUser As String, ByVal strPass As String, ByVal strMessage As String)
       'this subroutine requires your ASP.NET page to have a label control with an ID of lblStatus
       'create post variable for tweet
       Dim strTweet As String = "status=" & Server.HtmlEncode(strMessage)
       'convert post variable to byte array for transmission purposes
       Dim bRequest As Byte() = System.Text.Encoding.ASCII.GetBytes(strTweet)
       Try
           'create HttpWebRequest to status update API resource
           Dim objRequest As HttpWebRequest = WebRequest.Create("http://twitter.com/statuses/update.xml")
           'pass basic authentication credentials
           objRequest.Credentials = New NetworkCredential(strUser, strPass)
           'set method to post and pass request as a form
           objRequest.Method = "POST"
           objRequest.ContentType = "application/x-www-form-urlencoded"
           'tell the server it will not receive a 100 Continue HTTP response
           objRequest.ServicePoint.Expect100Continue = False
           'set content length of request
           objRequest.ContentLength = bRequest.Length
           'capture the stream (content) of the request
           Dim objStream As Stream = objRequest.GetRequestStream()
           'put the bytes into request
           objStream.Write(bRequest, 0, bRequest.Length)
           'close the stream to complete the request
           objStream.Close()
           'uncomment line below to report success
           'lblStatus.Text = "Tweet sent!"
           'You can also capture the XML response Twitter sends back
           'uncomment lines below to capture responses
           Dim objResponse As WebResponse = objRequest.GetResponse()
           Dim objReader As New StreamReader(objResponse.GetResponseStream())
           lblStatus.Text = objReader.ReadToEnd()
       Catch ex As Exception
           'uncomment line below to report ASP.NET errors
           lblStatus.Text = ex.Message
       End Try
   End Sub




Pls help on this..where i went wrong or what needs to be done with the IIS settings.

[edit]Code block added - OriginalGriff[/edit]
Posted
Updated 11-Jul-11 22:27pm
v2

1 solution

Please do not create a new question in order to reply: the person who asked for more information may not see it.
I have moved the new details into your old question.
Use the "Improve question" widget to edit your question and provide better information.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900