Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java¶Áдxml

ÕâÀï×ܽáÒ»ÏÂXMLÎļþµÄ¶Áд¹ý³Ì£¬ÏÈ˵һÏÂдµÄ¹ý³Ì£¬ÕâÀïÎÒÓõÄÊÇXmlDocumentµÄwrite·½·¨ÊµÏֵģ¬Ð´µÄ¹ý³ÌÊDZȽϼòµ¥µÄ£¬Ö»ÐèÒª¶¨Òå×Ô¼ºÏëÒªµÄÔªËرäÁ¿£¬
    Element user=null;
    Element username=null,password=null;
È»ºó
//    ¶¨Ò幤³§£¬Ê¹Ó¦ÓóÌÐòÄܹ»´Ó XML Îĵµ»ñÈ¡Éú³É DOM ¶ÔÏóÊ÷µÄ½âÎöÆ÷¡£
     DocumentBuilderFactory dbf=null;
     //¶¨Òå API£¬ ʹÆä´Ó XML Îĵµ»ñÈ¡ DOM ÎĵµÊµÀý¡£Ê¹ÓôËÀ࣬ӦÓóÌÐòÔ±¿ÉÒÔ´Ó XML »ñÈ¡Ò»¸ö Document
     DocumentBuilder db=null;
     //ʵÀý¹¤³§
     dbf = DocumentBuilderFactory.newInstance();
     //ʵÀýdocumentBuilder¶ÔÏó
     db = dbf.newDocumentBuilder();
     //ʵÀýXmlDocument±äÁ¿
     doc = new XmlDocument();
ÊÖ¶¯»ò´ÓÊý¾Ý¿âÀï²éÊý¾ÝΪÆ丳ֵ£¬
    username="helloxml";
    password="pass";
ʵÀýÔªËرäÁ¿
user = doc.createElement("UserInfomation");
//ʵÀýelement±äÁ¿
      username = doc.createElement("UserName");
      username.appendChild(doc.createTextNode(username1));
      user.appendChild(username);
      ¡£¡£¡£¡£¡£
//ÔÙÓÃXmlDocument¶ÔÏódoc½«¸ùÔªËص½xmlÎĵµ
 doc.appendChild(user);
×îºóͨ¹ýwrite·½·¨½«Æäдµ½Ö¸¶¨µÄÎļþÖÐ
if (path == null || path.equals("")) {
   path = "E:/user.xml";
  }
    try
    {
   //½«Êä³ö·¾¶Í¨¹ýOutputStreamWriter
      OutputStreamWriter  out = new OutputStreamWriter(
      new BufferedOutputStream(new FileOutputStream(path)), "UTF-8");
      //ÀûÓÃXmlDocumentµÄwrite·½·¨Ð´³öxmlÎļþ
      doc.write(out, "UTF-8");
      out.close();
   


Ïà¹ØÎĵµ£º

JAVA³ÌÐò´ÓÊôÐÔÎļþ£¨.Properties£©ÖÐÈ¡µÃijÊôÐÔµÄÖµ

Ò»¡¢µ÷ÓÃÊôÐÔÎļþÊôÐԵĴúÂ룺
 String url=SmsProperties.get("sms_address_frontend");//È¡µØÖ·Èç“sms_address_frontend=http://172.16.1.9:8280/sms_frontend/services/smsSenderWebService”
 String smsServer = SmsProperties.get("sms_server_name");//·¢ËͶÌÐŵķþÎñÕ˺Å(ÕâÀï¿ÉÒÔÈ¡ÖÐÎÄÊôÐ ......

[JAVA]intÀàÐͺÍbyte[]»¥×ª

package com.mapabc.sz_hbt.util;
/**
* <p>Title:ÕûÐÍÓ볤¶ÈΪ4µÄ×Ö½ÚÊý×éµÄ»¥»» </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2007-5-10</p>
* <p>Company: www.mapabc.com</p>
* @author luoyj
* @version 1.0
*/
public class Byte ......

³õʶJavaÄÚ²¿Àà

ÌáÆðJavaÄÚ²¿ÀࣨInner Class£©¿ÉÄܺܶàÈ˲»Ì«ÊìϤ£¬Êµ¼ÊÉÏÀàËƵĸÅÄîÔÚC++ÀïÒ²ÓУ¬ÄǾÍÊÇǶÌ×ÀࣨNested Class£©£¬¹ØÓÚÕâÁ½ÕßµÄÇø±ðÓëÁªÏµ£¬ÔÚÏÂÎÄÖлáÓжԱȡ£ÄÚ²¿Àà´Ó±íÃæÉÏ¿´£¬¾ÍÊÇÔÚÀàÖÐÓÖ¶¨ÒåÁËÒ»¸öÀࣨÏÂÎĻῴµ½£¬ÄÚ²¿Àà¿ÉÒÔÔںܶàµØ·½¶¨Ò壩£¬¶øʵ¼ÊÉϲ¢Ã»ÓÐÄÇô¼òµ¥£¬Õ§¿´ÉÏÈ¥ÄÚ²¿ÀàËƺõÓÐЩ¶àÓ࣬ËüµÄÓô¦¶ÔÓÚ³õ ......

³ÎÇåjavaÓïÑÔ½Ó¿ÚÓë¼Ì³ÐµÄ±¾ÖÊ

OOµÄ¾«Ë裬ÎÒÒÔΪ£¬ÊǶԶÔÏóµÄ³éÏó£¬×îÄÜÌåÏÖÕâÒ»µãµÄ¾ÍÊǽӿڡ£ÎªÊ²Ã´ÎÒÃÇÌÖÂÛÉè¼Æģʽ¶¼Ö»Õë¶Ô¾ß±¸Á˳éÏóÄÜÁ¦µÄÓïÑÔ£¨±ÈÈçc++¡¢java¡¢c#µÈ£©£¬¾ÍÊÇÒòΪÉè¼ÆģʽËùÑо¿µÄ£¬Êµ¼ÊÉϾÍÊÇÈçºÎºÏÀíµÄÈ¥³éÏó¡££¨cowboyµÄÃûÑÔÊÇ"³éÏó¾ÍÊdzéÈ¥ÏñµÄ²¿·Ö"£¬¿´ËƵ÷Ù©£¬ÊµÄËÖÁÀí£©¡£
Éè¼ÆģʽÖÐ×î»ù´¡µÄÊǹ¤³§Ä£Ê½£¨Factory£©£¬ÔÚÎÒ×î ......

ÎÒÃǵÄjavaʵѵ Óõ½µÄ֪ʶµã

±ðµÄ¶¼²»ËµÁË£¬ÎҵĸоõÊÇѧϰµ½ÁËÒ»ÖÖ¿ò¼ÜµÄ˼Ï룺¾ÍÊÇ¿ª·¢Ò»¸ö»ù´¡¿ò¼Ü£¬È»ºóÕâ¸ö¿ò¼ÜÔÙ±ðµÄµØ·½Ò»Ñù¿ÉÒÔʹÓã¡
±È½ÏÖØÒªµÄ֪ʶµã:
1: HTTP ЭÒé½âÎö£¬
2£º·â×°response ¡¢request
3£º¸øϵͳ¶¨ÖÆÈÕÖ¾×é¼þ
4£º¸øϵͳÌí¼ÓÅäÖÃÎļþ£¬Ôö¼ÓÁËϵͳµÄÁé»îÐÔºÍñîºÏÐÔ.ÕâÀïÖ÷ÒªÊÇÓõÄÒ»¸ö¿ªÔ´ÏîÄ¿£¨¾Ý˵Tomcat¾ÍÊÇÓõÄÕâ¸ö¿ªÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ