十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
Dim s As String = "ipconfig" vbNewLine " address10.3.11.162/address" vbNewLine "/ipconfig"
創(chuàng)新互聯(lián)建站堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的黑龍江網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
System.IO.File.WriteAllText("C:\我的文件夾\我的文件.xml", s)
你也可以把內(nèi)容放進(jìn)textbox中,然后把textbox的內(nèi)容寫進(jìn)去:
System.IO.File.WriteAllText("C:\我的文件夾\我的文件.xml", textbox1.text)
DataSet 和 DataTable都有現(xiàn)成的方法:WriteXml
DataTable tb = this.dataGridView1.DataSource as DataTable;
if(tb != null)
{
tb.WriteXml(@"C:\table.xml",true);
return;
}
DataView dv = this.dataGridView1.DataSource as DataView;
if(dv != null)
{
dv.Table.WriteXml(@"C:\table.xml",true);
return;
}
IList list = this.dataGridView1.DataSource as IList;
if(list != null)
{
//to do,如果是IList,就要你自己想辦法導(dǎo)出了
//XmlDocument or XmlWriter都可以考慮
}
DataSet
和
DataTable
都有現(xiàn)成的方法:WriteXml
DataTable
tb
=
this.
dataGridView
1.DataSource
as
DataTable;
if(tb
!=
null)
{
tb.WriteXml(@"C:\table.xml",true);
return;
}
DataView
dv
=
this.dataGridView1.DataSource
as
DataView;
if(dv
!=
null)
{
dv.Table.WriteXml(@"C:\table.xml",true);
return;
}
IList
list
=
this.dataGridView1.DataSource
as
IList;
if(list
!=
null)
{
//to
do,如果是IList,就要你自己想辦法導(dǎo)出了
//XmlDocument
or
XmlWriter
都可以考慮
}
有多種方法.
如果是vb.net,則其本身就有xml編輯支持,具有xml系統(tǒng)類,可以直接調(diào)用,再配合了listview來進(jìn)行可視化處理。
如果是vb 6.0
則可以借助外部的控件,或者別人做好的控件。
其實(shí)xml也是一種可編輯的純文本格式。
你可以在vb里用richtextbox的load方法加載,然后自己用find方法分析,在列出樹形圖。