Because the website is to use XML to do D ... is white, it is reading XML (don't even a couple ...) The program is the most under, and if you don't necessarily be the current data of the website, welcome http: // www .joysou.com 嘿嘿, I want to pull some people ..
The following is quoted fragment: Form1.cs using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Xml; namespace hellojoysou {/// < Summary> /// Form1's summary description. /// summary> public class form1: system.windows.Forms.form {private system.windows.forms.dataGrid visitors; private system.windows.Forms.Button getXML; ///
/// summary> private void InitializeComponent () {this.Visitors = new System.Windows.Forms.DataGrid (); this.GetXML = new System.Windows.Forms.Button (); ((System.ComponentModel.ISupportInitialize (this.visitors)). Begininit (); this.suspendlayout (); // // visitors // this.visitors.captiontext = "visitors"; this.visitors.DataMember = ""; this.visitors.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.Visitors.Location = new System.Drawing.Point (8, 8); this.Visitors.Name = "Visitors"; this.Visitors.PreferredColumnWidth = 100; this.Visitors.Size = New system.drawing.size (552, 184); this.visitors.tabindex = 0; this.visitors.naVigate = new system.windows.Forms.navigateEventHandler (this.visitors_navigate); // // getXml // this. GetXml.location = new system.drawing.point (32, 240); this.getxml.name = "getXML"; this.getxml.size = new system.drawing.size (64, 16); this.getxml.tabindex = 1; this.getxml.text = "getxml"; this.Getxm L.Click = new system.eventhandler (this.getxml_click); // // Form1 // this.autoscalebasesize = new system.drawing.size (6, 14); this.clientsize = new system.drawing.size (568 , 278); this.Controls.add (this.GETXML); this.Controls.add (this.visitors); this.maximizebox = false; this.name = "form1"; this.text = "form1"; this. Load = new system.eventhandler (this.form1_load); (this.visitor)). Endinit (); this.ResumeLayout (false);} #ENDREGION / /
/// summary> [STAThread] static void Main () {Application.Run (new Form1 ());} private void Form1_Load (object sender, System.EventArgs e) {} private void GetXML_Click (object sender, System. Eventargs e) {xmlDocument XML = new xmldocument (); // Create XMLDocument Xml.Load ("http://www.joysou.com/system/nothing.asp"); // Load XML file XMLNode Root = xml.documentelement.selectNodes ("/ joysou"). Item (0); xmlnodelist visitor = root.selectNodes ("info / visitors / visitor"); dataable dt = new dataable (); dt.columns.add (new Datacolumn ("Name", TypeOf (String))); DT.Columns.Add (New Datacolumn ("IP", TypeOf (String)))); DT.Columns.Add (New Datacolumn ("Address", TypeOf (String) )); DT.Columns.Add (New Datacolumn ("OS", TypeOf (String))); DT.COLUMNS.ADD (New Datacolumn ("Soft", TypeOf (String)))); for (int i = 0; I