private void BackgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
int num;
this.ListView1.Clear();
this.Button1.Text = "Annulla";
this.Bar.ShowInTaskbar = true;
this.ListView1.Columns.Add("link", 0);
this.ListView1.Columns.Add("Titolo", 0x2cc);
this.ListView1.Columns.Add("Dimensione", 0x5f);
this.ListView1.Columns.Add("Durata", 0x51);
this.ListView1.Columns.Add("Bitrate", 0x51);
string str = this.TextBox1.Text.Replace(" ", "_");
this.
html = new WebClient
().
DownloadString("http://mp3skull.com/mp3/" + str
+ ".html"); int startIndex = 0;
while (num != 0x7fffffff)
{
if (!this.annulla)
{
break;
}
try
{
bool flag;
int index = this.html.IndexOf("<div id=\"song_html\"", startIndex);
if (index == -1)
{
if (this.ListView1.Items.Count == 0)
{
Interaction.MsgBox("Ricerca Completata! Se non \x00e8 stato trovato nessun elemento ripetere la ricerca con i risultati consigliati o provando ad utilizzare meno keywords.", MsgBoxStyle.DefaultButton1, null);
this.Button1.Enabled = true;
this.Label3.Text = "";
this.Label5.Text = "";
}
break;
}
int num3 = this.html.IndexOf("<!-- info mp3 here -->", index) + 0x1b;
int num4 = this.html.IndexOf("<br />", num3);
string str3 = this.html.Substring(num3, num4 - num3);
if (str3.Length > 10)
{
str3 = "N/D";
num4 = index;
}
int num9 = this.html.IndexOf("<br />", num4) + 6;
int num10 = this.html.IndexOf("<br />", num9);
string str6 = this.html.Substring(num9, num10 - num9);
if (str6.Length > 10)
{
str6 = "N/D";
num10 = num9;
}
int num5 = this.html.IndexOf("<br />", num10) + 6;
int num6 = this.html.IndexOf("</div>", num5) - 3;
string str4 = this.html.Substring(num5, num6 - num5);
if (str4.Length > 10)
{
str4 = "N/D";
num6 = num5;
}
int num12 = this.html.IndexOf("<b>", num6) + 3;
int num13 = this.html.IndexOf("</b>", num12);
string str7 = this.html.Substring(num12, num13 - num12);
int num7 = this.html.IndexOf("<a href=", num13) + 9;
int num8 = this.html.IndexOf("\"", num7);
string plaintext = this.html.Substring(num7, num8 - num7);
if (plaintext.Contains("4shared"))
{
flag = true;
}
plaintext
= new Simple3Des
("link").
EncryptData(plaintext
); string[] items
= new string[] { plaintext, str7, str4, str6, str3
}; ListViewItem item
= new ListViewItem
(items
); if (!flag)
{
this.ListView1.Items.Add(item);
}
startIndex = num8;
Application.DoEvents();
num++;
flag = false;
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception exception = exception1;
ProjectData.ClearProjectError();
break;
ProjectData.ClearProjectError();
}
}
Application.DoEvents();
this.Label5.Text = "Ricerca Completata!";
this.Button1.Image = GetMusicPro.My.Resources.Resources.cerca_button;
this.Bar.ShowInTaskbar = false;
this.ProgBar.Value = 0;
this.Bar.Value = 0;
this.percValue.Text = "";
this.annulla = true;
this.Button1.Text = "Cerca";
}