/// <Summary>
/// Read group purchases from Meituan
/// </Summary>
/// <Param name = "sender"> </param>
/// <Param name = "E"> </param>
Private Void Button43_click ( Object Sender, eventargs E)
{
Xmldocument xml = New Xmldocument ();
If (! Directory. exists (environment. currentdirectory + " /Data. xml " ))
{
Uri uri = New Uri ( " Http://api.union.meituan.com/data/hao123v2/key/qtkECZsy0px6cwufQlIA2b3g7zSDNejU " );
Httpwebrequest request = (httpwebrequest) webrequest. Create (URI );
Webresponse response = request. getresponse ();
Stream stream = response. getresponsestream ();
Streamreader READ = New Streamreader (stream, encoding. getencoding ( " UTF-8 " ));
String Tuan = read. readtoend (). Replace ( " <DATA> " , "" ). Replace ( " <Display> " , "" ). Replace ( " </Data> " ,"" ). Replace ( " </Display> " , "" );
XML. loadxml (Tuan);
XML. save (environment. currentdirectory + " /data. XML ");
}< br> else
XML. load (environment. currentdirectory + " /data. XML ");
Xmlnodelist list = xml. getelementsbytagname ( " URL " );
Foreach (Xmlnode Node In List)
{
String [] X = New String [ 21 ]; //
X [ 0 ] = Node. childnodes [ 0 ]. Innertext; // Address
X [ 1 ] = Node. childnodes [ 1 ]. Innertext; // Phone number
X [ 2 ] = Node. childnodes [ 2 ]. Innertext; // Merchants
X [ 3 ] = Node. childnodes [ 3 ]. Innertext; // Name
X [ 4 ] = Node. childnodes [ 4 ]. Innertext; //
X [ 5 ] = Node. childnodes [ 5 ]. Innertext; //
X [ 6 ] = Node. childnodes [ 6 ]. Innertext;// Current Price
X [ 7 ] = Node. childnodes [ 7 ]. Innertext; // Original Price
X [ 8 ] = Node. childnodes [ 8 ]. Innertext; // Start Time
X [ 9 ] = Node. childnodes [ 9 ]. Innertext; // End Time
X [ 10 ] = Node. childnodes [ 10 ]. Innertext; // Image address
X [ 11 ] = Node. childnodes [ 11 ]. Innertext; // Title
X [ 12 ] = Node. childnodes [ 12 ]. Innertext; //
X [ 13 ] = Node. childnodes [13 ]. Innertext; // Address
X [ 14 ] = Node. childnodes [ 14 ]. Innertext; /// /Region
X [ 15 ] = Node. childnodes [ 15 ]. Innertext;//
X [ 16 ] = Node. childnodes [ 16 ]. Innertext; // Category
X [ 17 ] = Node. childnodes [ 17 ]. Innertext; //
X [18 ] = Node. childnodes [ 18 ]. Innertext; // City
X [ 19 ] = Node. childnodes [ 19 ]. Innertext; // City address
X [ 20 ] = Node. childnodes [20 ]. Innertext; // Website name
}
}