No hace falta que seas tan
generoso, mira, yo tambien puedo contribuir con tu codigo:
C# escribió:public void searchtest(object query)
{
this.Clearlist();
int Results = 1;
if (this.TreeView1.Nodes["history"].Nodes.IndexOfKey(Conversions.ToString(query)) < 0)
{
this.Addtolist(Conversions.ToString(query));
}
for (int count = 0; Results > 0; count++)
{
string buffer = new StreamReader(WebRequest.Create("http://77.67.11.180/search.php?q=" + Strings.Replace(Strings.Replace(Strings.Replace(Conversions.ToString(query), "\n", "", 1, -1, 0), "\r", "", 1, -1, 0), " ", "+", 1, -1, 0) + "&p=" + count.ToString()).GetResponse().GetResponseStream()).ReadToEnd();
Results = Strings.InStr(buffer, "<pre><a target='_parent' href='", 0);
string[] split1 = Strings.Split(buffer, "<pre><a target='_parent' href='", -1, 0);
int VB$t_i4$L0 = Information.UBound(split1, 1);
for (int a = 1; a <= VB$t_i4$L0; a++)
{
string artist2;
string title2;
string url2;
IEnumerator VB$t_ref$L0;
string split2 = Strings.Split(split1[a], "'>", -1, 0)[0];
string split6 = Strings.Split(split2, "listen/", -1, 0)[1];
string split7 = Strings.Split(split6, "/", -1, 0)[0];
XmlDocument m_xmld = new XmlDocument();
try
{
m_xmld.Load("http://www.goear.com/files/xmlfiles/" + split7.Substring(0, 1) + "/secm" + split7 + ".xml");
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception exception = exception1;
ProjectData.ClearProjectError();
}
XmlNodeList m_nodelist = m_xmld.SelectNodes("/songs/song");
try
{
VB$t_ref$L0 = m_nodelist.GetEnumerator();
while (VB$t_ref$L0.MoveNext())
{
XmlNode m_node = (XmlNode) VB$t_ref$L0.Current;
url2 = m_node.Attributes.GetNamedItem("path").Value;
title2 = m_node.Attributes.GetNamedItem("title").Value;
artist2 = m_node.Attributes.GetNamedItem("artist").Value;
}
}
finally
{
if (VB$t_ref$L0 is IDisposable)
{
(VB$t_ref$L0 as IDisposable).Dispose();
}
}
this.Addtotabla(title2, url2, artist2);
}
}
}
Visual Basic escribió:Public Sub searchtest(ByVal query As Object)
Me.Clearlist
Dim Results As Integer = 1
If (Me.TreeView1.Nodes.Item("history").Nodes.IndexOfKey(Conversions.ToString(query)) < 0) Then
Me.Addtolist(Conversions.ToString(query))
End If
Dim count As Integer = 0
Do While (Results > 0)
Dim buffer As String = New StreamReader(WebRequest.Create(("http://77.67.11.180/search.php?q=" & Strings.Replace(Strings.Replace(Strings.Replace(Conversions.ToString(query), ChrW(10), "", 1, -1, 0), ChrW(13), "", 1, -1, 0), " ", "+", 1, -1, 0) & "&p=" & count.ToString)).GetResponse.GetResponseStream).ReadToEnd
Results = Strings.InStr(buffer, "<pre><a target='_parent' href='", 0)
Dim split1 As String() = Strings.Split(buffer, "<pre><a target='_parent' href='", -1, 0)
Dim VB$t_i4$L0 As Integer = Information.UBound(split1, 1)
Dim a As Integer = 1
Do While (a <= VB$t_i4$L0)
Dim artist2 As String
Dim title2 As String
Dim url2 As String
Dim VB$t_ref$L0 As IEnumerator
Dim split2 As String = Strings.Split(split1(a), "'>", -1, 0)(0)
Dim split6 As String = Strings.Split(split2, "listen/", -1, 0)(1)
Dim split7 As String = Strings.Split(split6, "/", -1, 0)(0)
Dim m_xmld As New XmlDocument
Try
m_xmld.Load(String.Concat(New String() { "http://www.goear.com/files/xmlfiles/", split7.Substring(0, 1), "/secm", split7, ".xml" }))
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
ProjectData.ClearProjectError
End Try
Dim m_nodelist As XmlNodeList = m_xmld.SelectNodes("/songs/song")
Try
VB$t_ref$L0 = m_nodelist.GetEnumerator
Do While VB$t_ref$L0.MoveNext
Dim m_node As XmlNode = DirectCast(VB$t_ref$L0.Current, XmlNode)
url2 = m_node.Attributes.GetNamedItem("path").Value
title2 = m_node.Attributes.GetNamedItem("title").Value
artist2 = m_node.Attributes.GetNamedItem("artist").Value
Loop
Finally
If TypeOf VB$t_ref$L0 Is IDisposable Then
TryCast(VB$t_ref$L0,IDisposable).Dispose
End If
End Try
Me.Addtotabla(title2, url2, artist2)
a += 1
Loop
count += 1
Loop
End Sub
Managed C++ escribió:public: void __gc* searchtest(Object __gc* query)
{
this->Clearlist();
Int32 __gc* Results = 1;
if (this->TreeView1->Nodes[S"history"]->Nodes->IndexOfKey(Conversions::ToString(query)) < 0)
{
this->Addtolist(Conversions::ToString(query));
}
for (Int32 __gc* count = 0; (Results > 0); count++)
{
String __gc* buffer = __gc new StreamReader(WebRequest::Create(String::Concat(S"http://77.67.11.180/search.php?q=", Strings::Replace(Strings::Replace(Strings::Replace(Conversions::ToString(query), S"\n", S"", 1, -1, 0), S"\r", S"", 1, -1, 0), S" ", S"+", 1, -1, 0), S"&p=", count->ToString()))->GetResponse()->GetResponseStream())->ReadToEnd();
Results = Strings::InStr(buffer, S"<pre><a target=\'_parent\' href=\'", 0);
String __gc* split1 __gc [] = Strings::Split(buffer, S"<pre><a target=\'_parent\' href=\'", -1, 0);
Int32 __gc* VB$t_i4$L0 = Information::UBound(split1, 1);
for (Int32 __gc* a = 1; (a <= VB$t_i4$L0); a++)
{
String __gc* artist2;
String __gc* title2;
String __gc* url2;
IEnumerator __gc* VB$t_ref$L0;
String __gc* split2 = Strings::Split(split1[a], S"\'>", -1, 0)[0];
String __gc* split6 = Strings::Split(split2, S"listen/", -1, 0)[1];
String __gc* split7 = Strings::Split(split6, S"/", -1, 0)[0];
XmlDocument __gc* m_xmld = __gc new XmlDocument();
try
{
m_xmld->Load(String::Concat(__gc new String __gc*[5] {
S"http://www.goear.com/files/xmlfiles/", split7->Substring(0, 1), S"/secm", split7, S".xml"}));
}
catch (Exception __gc* exception1)
{
ProjectData::SetProjectError(exception1);
Exception __gc* exception = exception1;
ProjectData::ClearProjectError();
}
XmlNodeList __gc* m_nodelist = m_xmld->SelectNodes(S"/songs/song");
try
{
VB$t_ref$L0 = m_nodelist->GetEnumerator();
while (VB$t_ref$L0->MoveNext())
{
XmlNode __gc* m_node = *static_cast<__box XmlNode*>(VB$t_ref$L0->Current);
url2 = m_node->Attributes->GetNamedItem(S"path")->Value;
title2 = m_node->Attributes->GetNamedItem(S"title")->Value;
artist2 = m_node->Attributes->GetNamedItem(S"artist")->Value;
}
}
finally
{
if ((VB$t_ref$L0 is IDisposable))
{
(VB$t_ref$L0 as IDisposable)->Dispose();
}
}
this->Addtotabla(title2, url2, artist2);
}
}
}
¿Quieres mas lenguajes? Tambien tengo Delphi .NET, y para lo
hardcore, IL. Protip: los binarios de .NET no son compilados, son interpretados.
Maky^^: que te pongas a insultar de buenas a primeras dice mucho de tu madurez.