I am using Visual Studio 2010, and this is my first time using an API. When I try to use the Last.FM API, I get the "type or namespace name 'Lastfm' could not be found..." for lines 10 and 48. I've looked at some other StackOverflow questions on similar topics, but none seemed to apply directly.
I downloaded the lastfm-sharp.dll from http://code.google.com/p/lastfm-sharp/downloads/list and placed it in the projects folder. I then added it as a reference and do not recall doing anything else. I then used the example in http://code.google.com/p/lastfm-sharp/wiki/Examples to write my code.
Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Lastfm.Services;
namespace MusicOrganize
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
DIRECTORY = this.FilePath.Text;
}
private void FilePath_TextChanged(object sender, EventArgs e)
{
DIRECTORY = this.FilePath.Text;
}
//Choose what Folder to work with
private void BrowseBtn_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
this.FilePath.Text = folderBrowserDialog1.SelectedPath;
}
}
//Organize Music in selected Directory
private void OrganizeBtn_Click(object sender, EventArgs e)
{
//Put all tracks into one folder
Music.Consolidate(DIRECTORY);
string API_KEY = "****";
string API_SECRET = "****";
Session session = new Session(API_KEY, API_SECRET);
Music.GetTrackTags();
}
public string DIRECTORY;
}
}
Thanks for any help you can provide.