The Chi-lites
Soul
A lonely man
1972
Babyface
R&B
unknown
Babyface
R&B
The essential babyface
2001
Babyface
R&B
Grown and sexy
2005
Maria Arredondo
Pop
Not going under
2004
Leona Lewis
Pop
Unknown
2008
Usher
R&B
Usher
2008
Christina Aguilera
Blues
Back to basics
2004
Sting
Pop
Shape of my heart
DataSet ds = new DataSet();
TextReader reader = new StringReader(@"
The Chi-lites
Soul
A lonely man
1972
Babyface
R&B
unknown
Babyface
R&B
The essential babyface
2001
Babyface
R&B
Grown and sexy
2005
Maria Arredondo
Pop
Not going under
2004
Leona Lewis
Pop
Unknown
2008
Usher
R&B
Usher
2008
Christina Aguilera
Blues
Back to basics
2004
Sting
Pop
Shape of my heart
");
//读取Xml字符串 用来接收WebService返回数据
//ds.ReadXml(reader, XmlReadMode.Auto);
//读取Xml文件
ds.ReadXml(Server.MapPath("XML/Song.xml"));
//生成Xml文件
//ds.WriteXml(Server.MapPath("xml/song_bak.xml"));
GridView1.DataSource = ds;
GridView1.DataBind();
//读取txt文件
Stream stream = new FileStream(Server.MapPath("XML/demo.txt"), FileMode.OpenOrCreate, FileAccess.Read);
StreamReader readStream = new StreamReader(stream, System.Text.Encoding.GetEncoding("GB2312"));
string SourceCode = readStream.ReadToEnd();
readStream.Close();
Response.Write(SourceCode);