Read group buying

Source: Internet
Author: User
///   <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
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.