Hi, To find the error details, you will have to handle exceptions in your code. The server returns a 403 (Forbidden) HTTP status code for a bad password and .NET raises a corresponding System.Net.WebException.
You will have to read the Response property of the WebException object to find out the actual cause. For a bad password, the server returns 'Error=BadAuthentication"' in the response body. For a complete list of error messages, visit the following link: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors You can find reference code in Google's open source .NET GData client library to handle the exception. Here is a link to the code: http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/core/gauthrequest.cs#554 You can also consider using the .NET GData client library which includes ClientLogin and Provisioning API: http://code.google.com/apis/apps/libraries_and_samples.html Thanks, Anirudh On May 29, 7:40 pm, Bam <[EMAIL PROTECTED]> wrote: > this is my sample code > > .... > > HttpWebResponse MyResponse = (HttpWebResponse)MyRequest.GetResponse(); > > // set Stream response > Stream strmMyResponse = MyResponse.GetResponseStream(); > StreamReader strRdrMyResponse = new StreamReader(strmMyResponse); > > // set Response to variable > string strResponse = strRdrMyResponse.ReadToEnd(); > > MyResponse.Close(); > strmMyResponse.Dispose(); > strRdrMyResponse.Dispose(); > > .... > > When I post with the right username and the wrong password. > The code always break and highlighted on the first line > ( HttpWebResponse MyResponse = > (HttpWebResponse)MyRequest.GetResponse();) > > My answer is how to get error or response from google?? > > Thanks, > > On May 29, 5:36 pm, "Anirudh (Google)" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > To find out under what circumstances a server generates a CAPTCHA > > challenge, please visit the following FAQ > > link:http://code.google.com/support/bin/answer.py?answer=55392&topic=11282 > > > > There are a couple of ways to handle the CAPTCHA challenge. Please > > refer our FAQ for the > > same:http://code.google.com/support/bin/answer.py?answer=55394&topic=11282 > > > Thanks, > > Anirudh > > > On May 28, 12:18 am, Bam <[EMAIL PROTECTED]> wrote: > > > > How to get captcha error?? > > > > Can you give me sample code to handle captcha error or captcha > > > required?? > > > > thanks- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Apps APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-apps-apis?hl=en -~----------~----~----~----~------~----~------~--~---
