| 发表于:2007-10-10 12:34:261楼 得分:0 |
您可以在使用xml dom模型中的对象在vb中生成xml文件。如下例,您能把文本框text1中的内容作为一个字符串节点写入xml文件。 private sub command1_click() set xmldoc = createobject("msxml2.domdocument") set rootelement = xmldoc.createelement("memo") set toelement = xmldoc.createelement("to") set toelementtext = xmldoc.createtextnode(text1.text) xmldoc.appendchild (rootelement) rootelement.appendchild (toelement) toelement.appendchild (toelementtext) xmldoc.save ("c:\test1.xml") end sub 详细信息请参考以下链接: working with xml document parts http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmconworkingwithxmldocumentparts.asp - 微软全球技术中心 vb技术支持 本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款 (http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。 为了为您创建更好的讨论环境,请参加我们的用户满意度调查 (http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(s,49854782))。 | | |
|