Make a wrapper function around this call and pass the values through
this.
An example would be:
public static ArrayList GetContacts(string userName, string password)
{
ArrayList contactsList = new ArrayList();
ContactsService myService = new ContactsService("YourAppName");
myService.setUserCredentials(userName, password)
.....
Your rest of the code goes here...
.....
return contactsList;
}
An example to use the above function will be:
(Am using .NET notation)
protected void ShowContacts_Click(object o, EventArgs e)
{
ArrayList contactsList = ContactsRetriever.GetContacts
(txtUserName.Text, txtPassword.Text);
}
I guess this will help you out.
-Sanket
On Dec 23, 1:22 pm, Raj <[email protected]> wrote:
> Hello All,
>
> I am using google contacts api and I am able to retrieve the contacts
> from gmail.
>
> But for this I need to hardcode the credentials "userid" and
> "password" in following method.
>
> ContactsService myService = new ContactsService("exampleCo-
> exampleApp-1");
> myService.setUserCredentials("[email protected]", "password");
>
> from where can I get the userid and password so that I can user that
> info and need not to hardcode the values?
>
> thanks in advance.
>
> RAJESH
--
You received this message because you are subscribed to the Google Groups
"Google Contacts API" 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-contacts-api?hl=en.