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

linq to xml(MOSS GetCurrentUser)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml;
using System.IO;
using System.Data;
using System.Data.Linq;
namespace XmlGetUserInfo
{
public class GetUser:WebPart
{
SPWeb sWeb;
SPUser currUser;
private string AddUser()
{
sWeb = SPControl.GetContextWeb(Context);
currUser = sWeb.CurrentUser;
XElement employees = null;
StringBuilder user = new StringBuilder();

//create and writer xml
//string strFilename = Environment.CurrentDirectory + @"\txtuser.xml";//get filename
string strFilename = System.AppDomain.CurrentDomain.BaseDirectory + @"\txtuser.xml";
if(!File.Exists(strFilename))
{
XmlWriterSettings xws=new XmlWriterSettings();
xws.OmitXmlDeclaration=true;
using (XmlWriter writer = XmlWriter.Create(strFilename,xws))
{
employees = new XElement("Root",
new XElement("Employee",
new XElement("Name", currUser.Name), new XElement("Email", currUser.Email)
)
);
employees.Save(writer);
}
}
else
{
employees = XElement.Load(strFilename);
XElement tree=new XElement("Root",
new XElement("Employee",
new XElement("Name", currUser.Name), new XElement("Email", currUser.Email)),
from el in employees.Elements()
select el);
TextReader tr = new StringReader(tree.ToString());
XElement xel =


Ïà¹ØÎĵµ£º

Ajax£ºÓµ±§JSON£¬ÈÃXML×ß¿ª


Ajax(Asynchronous JavaScript and XML)˵µ½µ×¾ÍÊÇÒ»ÖÖä¯ÀÀÆ÷Òì²½¶ÁÈ¡·þÎñÆ÷ÉÏXMLÄÚÈݵļ¼Êõ¡£ÏÖÔڵļ¼Êõ·²ÊǸúXML³¶ÉϹØÏµ£¬ÔÙ¼ÓÉϸö¸ÅÄî×ö»Ï×Ó£¬¾ÍÏñ½ð×°ÁËÒ»Ñù£¬×§µÃ²»ÐС£ÃÅÍâ µÄÈË¿´µÃºÜÊÇÈÈÄÖ£¬ÃÅÀïµÄÈËÒ¡Ò¡Í·²»ÍâÈçÊÇ¡£XMLÄØ£¬¿çƽ̨µÄг±ÓïÑÔ£¿ÆäʵXML£½TXT¡£
XMLÖ»ÊÇ·ûºÏºÜ¶à¹æ·¶µÄÎı¾¡£Ëü±¾Éíʲô¶¼²»ÊÇ£¬Ö ......

ÓÃJAXB´æÈ¡XMLÊý¾Ý

JAXB¸ÅÒª
JAXBΪJava Architecture for XML BindingµÄËõд£¬ÒâΪXML°ó¶¨µÄJAVA¿ò¼Ü¡£ËüÌṩÁËÒ»Ì׿ÉÒÔ¼òµ¥´æÈ¡XMLÊý¾ÝµÄAPI£¬Í¬Ê±£¬JAXB¿ÉÒÔ¸ù¾ÝXMLµÄschema×Ô¶¯Éú³É²Ù×÷XMLµÄJAVAÀà¡£ÀûÓÃJAXB£¬Ê¹ÓÃJAXB×Ô¶¯Éú³ÉµÄ²Ù×÷XMLµÄJAVAÀ࣬¿ÉÒÔ»ù±¾Éϲ»Óÿ¼ÂÇXML½á¹¹¶ø¼òµ¥µØ´æÈ¡XMLÊý¾Ý¡£
JAXBµÄÏÂÔØÓë°²×°
JAXBÖÁÉÙÐèÒªµ¼ÈëÒ ......

XmlÎļþ²Ù×÷ºÍÎļþ²Ù×÷(FileInfoÀà)

XmlÎļþ²Ù×÷ºÍÎļþ²Ù×÷(FileInfoÀà)
  1. ÉÏ´«Îļþ
¡¡2. дXmlÎļþ
   3.  Îļþ¿½±´
 
¡¡1.¡¡//ÉÏ´«
        protected void picUp_Click(object sender, EventArgs e)
        {
     ......

ʹÓÃXmlDocumentÀàÍê³É¶ÔXMLµÄ²é¡¢É¾¡¢Ìí¡¢¸Ä

ʹÓÃXmlDocumentÀàÍê³É¶ÔXMLµÄ²é¡¢É¾¡¢Ìí¡¢¸Ä
http://www.aspdiy.net/article/53.htm
ºǫ́C#´úÂë
  1using System;
  2using System.Collections;
  3using System.ComponentModel;
  4using System.Data;
  5using System.Drawing;
  6using System. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ