Posted Tue Nov 11, 2014 8:23 am
try this .
- Code:
using Microsoft.VisualBasic;
using agsXMPP;
using agsXMPP.Xml.Dom;
using agsXMPP.protocol.client;
using agsXMPP.protocol.x.muc;
x.OnReadXml += Xml;
HttpWebRequest request;
string str2;
private void Xml(object sender, string xml)
{
if (base.InvokeRequired)
{
base.BeginInvoke(new XmlHandler(this.Xml), new object[] { RuntimeHelpers.GetObjectValue(sender), xml });
}
else
{
try
{
xml = xml.Replace("\"", "'");
if (Strings.InStr(xml, "from='token.nimbuzz.com'", CompareMethod.Text) != 0)
{
if (Strings.InStr(xml, "id='N-World'", CompareMethod.Text) != 0)
{
string str1 = xml.Substring(xml.IndexOf("token'>") + 7);
str1 = str1.Substring(0, str1.IndexOf("</")).Replace("amp;", "");
request = (HttpWebRequest)WebRequest.Create(str1);
HttpWebResponse response2 = (HttpWebResponse)request.GetResponse();
str2 = request.Address.ToString();
str2 = str2.Substring(str2.IndexOf("ID=") + 3);
}
}
}
catch { }
}
}
private void timer1_Tick(object sender, EventArgs e)
{
this.timer1.Interval = 60000;
try
{
x.Send("<iq xmlns='jabber:client' type='get' id='code123' to='token.nimbuzz.com'><query xmlns='nimbuzz:token'><type>shop</type><branch>J2ME</branch><version><major>2</major><minor>1</minor></version><category /></query></iq>");
}
catch { }
}
private void button2_Click(object sender, EventArgs e)
{
request = (HttpWebRequest)WebRequest.Create("http://shop.nimbuzz.com/social/contact?user=" + textBox3.Text + "&list=profile&PHPSESSID=" + str2);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string str = new StreamReader(response.GetResponseStream()).ReadToEnd();
string since = str.Substring(str.IndexOf("Nimbuzz user since") + 61);
since = since.Substring(0, since.IndexOf("</strong></td>"));
textBox5.Text = since;
}