2012-01-02 5 views
1

Twitter 요청을 시도 할 때마다 항상 내 응용 프로그램이 중단됩니다. oAuthUtility에는 적용되지 않지만 사용자가 내 응용 프로그램을 사용할 수 있도록 권한을 부여했지만 요청할 때마다 중단됩니다. 여기가 제작하고있는 요청을 한 것은 응답 :TwitterResponse가 Silverlight에서 응답하지 않습니다.

 Dim response As TwitterResponse(Of TwitterStatus) = TwitterStatus.Update(myFire_tokens.Tokens, TextBox1.Text) 
    If response.Result <> RequestResult.Success Then 
     MessageBox.Show(response.ErrorMessage, "Error", MessageBoxButton.OK) 
    Else 
     MessageBox.Show("Tweet Sent", "Awesome!", MessageBoxButton.OK) 
    End If 
이 중단 버전 2.4 및 버전에서 발생

: 나는 보라 문제는 TwitterResponse에게 있습니다 504, 516, 및 523 실버 5 일, 4를하기 때문에 이 메소드는 Fiddler에서 OK 응답을 볼 수 있기 때문에 호출됩니다 (예 : 위 코드를 실행하면 짹짹이 게시됩니다).

디버거에서 예외가 throw되지 않고 응용 프로그램이 중단됩니다.

답변

1

SilverlightAsync 프로젝트와 연결해야합니다.

public static IAsyncResult Update(
    OAuthTokens tokens, 
    string text, 
    StatusUpdateOptions options, 
    TimeSpan timeout, 
    Action<TwitterAsyncResponse<TwitterStatus>> function) 

통지 추가로 두 개의 매개 변수 : 당신은 실버 라이트 측에있는 경우

, 그것은이 서명을 사용했을까요?

코드는 다음과

TwitterStatus.Update(
    myFire_tokens.Tokens, 
    TextBox1.Text, 
    Nothing, 
    0, 
    Sub (response As TwitterAsyncResponse<TwitterStatus>) 
     If response.Result <> RequestResult.Success Then 
      MessageBox.Show(response.ErrorMessage, "Error", MessageBoxButton.OK) 
     Else 
      MessageBox.Show("Tweet Sent", "Awesome!", MessageBoxButton.OK) 
     End If 
    End Sub) 
+0

감사처럼 보일 것이다! 그것은 효과가있다! –