D Busѧϰ£¨Æߣ©£ºÀûÓÃXML¶¨ÒåD BusÖ®ClientµÄÀý×Ó
¡¡¡¡¼ÌÐøѧϰD-Bus¡£Ö®Ç°Ñ§Ï°ÁËʹÓõײãµÄAPIÀ´·¢ËÍ£¬¼àÌýÏûÏ¢µÄ·½Ê½¡£ÔÚ
D-
Busѧϰ£¨ËÄ£©£º»ù´¡Ð¡Àý×Ó£¨Í¬²½ºÍÒì²½£©
Ö®ÖУ¬ÎÒÃǸø³öÁËÀûÓÃproxy½øÐз¢ËÍmethod_call£¬²¢µÈ´ýmethod_reply»òÕßerrorµÄclientÇé¿ö¡£ÔÚD-BusÖУ¬¿ÉÒÔ½«D-Bus½Ó¿Ú¶¨ÒåÓÃXML¸ñʽ±íÊö´¦Àí£¬²¢ÀûÓù¤¾ß£¬×Ô¶¯Éú³ÉÍ·Îļþ£¬¸ø³ö¹¤ÕûµÄµ÷Ó÷½Ê½¡£ÏÂÃæÊÇÒ»¸öXMLµÄÀý×Ó¡£
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/com/wei/MyObject">
<interface name="com.wei.MyObject.Sample">
<method name="Test">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="wei_response" />
<arg type="u" name="x" direction="in" />
<arg type="d" name="d_ret" direction="out" />
</method >
</interface >
</node >
¡¡¡¡ÆäÖÐannotationÊÇ×÷ΪserverÓã¬ÔÚÏÂÒ»´ÎѧϰÖÐʹÓá£ÎÒÃǸøÕâ¸öxmlÎļþÒ»¸öÃû×Ö£¬wei.xml¡£½áºÏÎÒÃÇÉÏÁ½´ÎѧϰÖеÄͼ£¬nodeʵ¼ÊÉϾÍÊÇÏ൱ÓÚ¶ÔÏó£¬ÓÃpathÀ´½øÐÐÃèÊö¡£Ê¹ÓÃdbus-bingding-toolÀ´Éú³ÉÍ·Îļþ£º
dbus-binding-tool --mode=glib-client --prefix=com_wei
wei.xml
>
wei_client.h
¡¡
¡¡
¡¡¡¡Í·ÎļþÖиø³öÁËͬ²½µ÷ÓúÍÒì²½µ÷ÓõÄÄÚÈÝ£¬ÎÒÃǸø³öÒ»¸öǰ׺com_wei£¬½«ÔÚÍ·ÎļþÖгöÏÖ£¬Í·ÎļþÄÚÈÝÈçÏ£º
/* Generated by dbus-binding-tool; do not edit! */
#include <glib.h>
#include <dbus/dbus-glib.h>
G_BEGIN_DECLS
#ifndef _DBUS_GLIB_ASYNC_DATA_FREE
#define _DBUS_GLIB_ASYNC_DATA_FREE
static
#ifdef G_HAVE_INLINE
inline
#endif
void
_dbus_glib_async_data_free (gpointer stuff)
{
g_slice_free (DBusGAsyncData, stuff);
}
#endif
#ifndef DBUS_GLIB_CLIENT_WRAPPERS_com_wei_MyObject_Sample
#define DBUS_GLIB_CLIENT_WRAPPERS_com_wei_MyObject_Sample
static
#ifdef G_HAVE_INLINE
inline
#endif
//ÕâÊÇͬ²½µ÷ÓÃÄÚÈÝ
gboolean
com_wei
_M
Ïà¹ØÎĵµ£º
ÕªÒª£ºÎÒÃÇÃèÊöÒ»¸ö¼òµ¥µÄÒµÎñϵͳµÄÓÃÀý£¬È»ºó½éÉܲ»Í¬µÄʵÏÖ¼¼Êõ¼°Æä±È½Ï¡£ÎÒûÓÐ×ö¹ýʵ¼ÊµÄ»ùÓÚSW¼¼ÊõµÄÐÅϢϵͳ£¬Òò´Ë±¾ÎÄÖ»ÊÇһЩ²ÂÏëÐԵĶ«
Î÷£¬Ï£ÍûÅ×שÒýÓñ£¬Äܵõ½´ó¼ÒµÄÖ¸½Ì,Ò²»¶Ó´ó¼Ò²¹³ä£¬Ð»Ð»£¡
×¢ÒâÎÒÃÇÌÖÂ۵ĶÔÏóÊÇ´«Í³µÄMISϵͳ£¬ÈçͼÊé²éѯϵͳ£¬Ñ§Éú¹ÜÀíϵͳ֮ÀàµÄ¡£
ÓÃÀý£º Óû§ÔÚ²éѯ½çÃæÑ¡Ôñ ......
Îĵµ¼°´úÂëÏÂÔØ£ºhttp://www.dingos.cn/index.php?topic=1899.0
½éÉÜ
µ±²Ëµ¥ÏîÊǾ³£¸Ä±äʱ£¬´ÓXMLÎĵµÖд´½¨TreeView²Åµ±ÊǷdz£ÓÐÓõġ£ÀýÈ磬ʹÓÃXML×÷ΪÊý¾Ý¿â´æ´¢¼Ç¼¡£
ÕâÀïÓиö¼òµ¥Ê¾Àý¡£ÒÔ·À»ìÏýÕâ¸öÀý×ӱȽϼòµ¥¡£
±³¾°
¶ÔXML¡¢TreeView¿Ø¼þµÄÓ¦Óã¬ÔÚVisual StudioÖÐÓÐÖúÓÚÀí½âÕâЩ²½Öè¡£
ʹÓôúÂë
×¢Ò⣠......
ÔÚ×î½üµÄÏîÄ¿ÖУ¬Å¼Óöµ½Ò»¸ö¿ÉÒÔ˵ºÜСµÄÎÊÌ⣬¾²ÏÂÐÄÀ´£¬ÓÐÏë°ÑËü¼ÇÏÂÀ´µÄ³å¶¯£¬Ëæ²úÉúÕâ²»³ÉÎĵļ¸¶ÎÎÄ×Ö¡£
ÔÚÎÒÓÃReadXml£¨£©ºÍReadSchema£¨£©¶ÁÈ¡XMLÎļþʱ£¬×ÜÊdzöÏÖÒì³££¬ºóÀ´¾¹ýµ÷ÊÔ·¢ÏÖ±¨XmlExceptionÒì³£²¢Ìáʾ“ȱÉÙ¸ùÔªËØ&rd ......
---xml²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®
--²âÊÔÊý¾Ý
if object_id('[tb]') is not null drop table [tb]
create table [tb]([a] varchar(200))
go
insert [tb]
select 'aaaa bbbb cccc dddd'
insert [tb]
select 'eeeeee ffff hhhh   ......
´Ë²¿·ÖÔ´ÂëΪ×îºËÐIJ¿·Ö´úÂ룡
package com.etong.allen;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
impor ......