Nreeb Hit: Nyeem ntawv InfoPath XML los ua SPListItem nyob SharePoint

Kuv yuav tau ua hauj lwm rau ib tug yog ib qhov uas kuv tau extract attachments ntawm ib daim ntawv InfoPath. Muaj ib co kev pab zoo rau cov parsing InfoPath ntawv (uas yog cia li XML ntaub ntawv, li ntawd, nws tseem ua tau kuj yooj yim).

Thaum kuv nyob tsev pem peb tes num, Yog daus ib daim ntawv InfoPath thiab txuag kuv lub zog tsav. C# chaws kuv twb nyeem tawm ntawd lom. Txawm li cas los, muab cov ntaub ntawv InfoPath yeej nyob hauv lub tsev qiv ntawv tuaj SharePoint. Kuv puas tau me ntsis ib nrab hearted searching seb yuav ua li cas rau nws ntawm lub tsev qiv ntawv nyeem thiab yuav luag tej tiaj, ua which thaum kuv yuav muaj rua daim ntawv mus rau ib lub zos temp directory thiab nyeem nws yeej muaj. Txawm li cas los, yuav tsis muaj los ntawm cov hoops mus raws li koj tau nyeem nws ncaj qha los ntawm lub tsev qiv ntawv. No me snippet qhia li cas:

/// Hoob txhais khoom ntawm no, xws li:
lwm yam SPFile mySharePointFile; /* Ib feem ntawm ib SPList */
// Chaws ntxiv mus ntawm no thiab sab hauv tus qauv ntawm cov hoob kawm peb muaj:
XmlTextReader textReader;
textReader = tshiab XmlTextReader(mySharePointFile.OpenBinaryStream());

textReader.WhitespaceHandling = WhitespaceHandling.All;

textReader.Read();

// Yog hais tias qhov ntawm lawm tus nqi

thaum lub (textReader.Read())
{

... ua li ntawm ces yees...

Lawv tseem ceeb ntsis saum toj noj yog tias peb yuav nyeem tau qhov InfoPath ntawm cov OpenBinaryStream() txoj kev hu xov tooj rau ntawm tus SPFile li ib parameter kom cov constructor nyob XmlTextReader. Nws great xwb.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ntawv cim npe Technorati:

Ib tug xav rau"Nreeb Hit: Nyeem ntawv InfoPath XML los ua SPListItem nyob SharePoint

  1. nesreen

    nyob zoo,
    Kuv xav tau kev pab nyob rau hauv no , Kuv muaj sharepoint 2007 qhov chaw thiab infopath nrog rau ib lub rooj repeating , dab tsi kuv yuav tsum yog thaum koj tsab ntawv rua rau lub sharepoint tuaj qiv kuv yuav tau mus ntxees thiab txuag tau cov ntaub ntawv rau ib daim ntawv uas siv SP daim ntawv qiv tej handler.

    Kev pab yog yeej menyuam.

    Tsaug

    Teb

sau ntawv cia

Koj email chaw nyob yuav tsis muab luam tawm. Search cim *