private string getSignature() { string str = ""; foreach (string key in this.Parameters.Keys) { str += key + this.Parameters[key]; } str += this.Session.APISecret; return(LastFMScrobble.MD5(str)); }
/// <summary> /// Authenticate this session using a username and a md5 hash of the password. /// </summary> /// <param name="username"> /// A <see cref="System.String"/> /// </param> /// <param name="md5Password"> /// A <see cref="System.String"/> /// </param> public void Authenticate(string username, string md5Password) { RequestParameters p = new RequestParameters(); p["username"] = username; p["authToken"] = LastFMScrobble.MD5(username + md5Password); Request request = new Request("auth.getMobileSession", this, p); request.signIt(); XmlDocument doc = request.execute(); SessionKey = doc.GetElementsByTagName("key")[0].InnerText; }
private void btTestLogin_Click(object sender, EventArgs e) { try { LastFMScrobble profile = new LastFMScrobble(); if (profile.Login(tbLastFMUsername.Text,tbLastFMPassword.Text)) MessageBox.Show("Login OK!"); else MessageBox.Show("Invalid login data or no connection !"); } catch (Exception exception) { MessageBox.Show(exception.Message); } }