易截截图软件、单文件、免安装、纯绿色、仅160KB

VB.NET2005读取XML数据

通过调用CreateDataSetfromXml取得XML数据
Imports System.Xml
Public Const FILE_CONFIG = "MZZ.xml"
Public Const PATH_CONFIG = "\XML\"
Dim dstXML As DataSet
Dim tblXML_DB As DataTable
Dim dtCod As New DataTable
Dim strSQL As String = ""

clsPublic.pstrAppPath = System.Windows.Forms.Application.StartupPath'启动程序路径
'启动程序上级目录(InStrRev是取得最后显示\的位置)
clsPublic.pstrAppPath = Mid(clsPublic.pstrAppPath, 1, InStrRev(clsPublic.pstrAppPath, "\", ) - 1)
'只能启动一个程序
If UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
Exit Sub
End If
'读取XML数据(QDIS节点,作为一个table,所以是dstXML.Tables(0))
dstXML = CreateDataSetfromXml(FILE_CONFIG)
tblXML_DB = dstXML.Tables(0)
clsDBBase.Uid = tblXML_DB.Rows(0).Item("UserId")
clsDBBase.Psw = tblXML_DB.Rows(0).Item("Password")
clsDBBase.Dsn = tblXML_DB.Rows(0).Item("DataSource")
'(APPL节点,作为一个table,所以是dstXML.Tables(1))
clsPublic.Timer_Interval = CType(dstXML.Tables(1).Rows(0).Item("Interval"), Integer)
'内存整理
GC.Collect()
Public Function CreateDataSetfromXml(ByVal strFileName As String) As DataSet
Dim xmlDoc As XmlDataDocument = New XmlDataDocument
Dim xmlReader As StreamReader = Nothing
Try
xmlReader = New StreamReader(clsPublic.pstrAppPath & PATH_CONFIG & strFileName)
xmlDoc.DataSet.ReadXml(xmlReader, XmlReadMode.Auto)
Return xmlDoc.DataSet.Copy
Catch ex As Exception
Return Nothing
Finally
Try
If Not xmlReader Is Nothing Then
xmlReader.Close()
xmlReader = Nothing
End If


相关文档:

XML 命名空间(XML Namespaces)


XML 命名空间可提供避免元素命名冲突的方法。
命名冲突
由于 XML 中的元素名是预定义的,当两个不同的文档使用相同的元素名时,就会发生命名冲突。
这个 XML 文档携带着某个表格中的信息:
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</ta ......

VB.NET/C# and JavaScript communication

Introduction
This article is about passing data between VB.NET/C# WinForms and JavaScript.
Before reading further, let me warn you that this article is not about ASP.NET. Concepts covered in the article are applied to Desktop applications.
Background
I was working on a project which required dat ......

magento 开发 另一种方式用xml来布局

是否厌倦了用xml文件来做Magento的页面布局,是的话来试试下面这种方式,把布局代码写到controller 里面
public function mycoolAction()
{
/* ... Some code ...*/
$update = $this->getLayout()->getUpdate();
/* ... Some code ...*/
$this->addActionLayoutHandles();
/* ... Some code ...*/
......

Java and XML_读书笔记_2010 05 16

2010-05-16
三、解析XML文档
l  Xerces解析器、SAX类和接口
l  SAX阅读器
n  首先要得到一个符合SAX org.xml.sax.XMLReader接口规范的例子,这个接口定义了解析行为并允许设置某些特征和属性。该接口替换了SAX1.0中的org.xml.sax.Parser
import org.apache.xerces.parsers.SAXParser;
import org.xml. ......

在vb中使用Iphlpapi.dll获取网络信息 第一章 前言

※==================================================================
※本连载文章说明:
※1、连载首发于《软件报》(http://www.sweek.com)2006年21期(2006年5月22日);
※2、此次网上连载采用的是原稿件结构,内容与《软件报》发表略有不同;
※3、谢绝除《软件报》及其相关刊物之外的传统媒体部分或全部转载 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号