[70-541, #5] - Come effettuare il check-out ed il download di un documento in SharePoint

Tramite questa funzione è possibile effettuare il check-out di un documento ed effettuare il download dello stesso. Questa funzione può essere utilizzata abbinata a quella di verifica dello stato di check-out descritta nel precedente post.

 

// Effettuare il check-out di un file ed effettuare il download del suo

// contenuto passando come argomento l’URL dello stesso

public byte[] CheckOut(string fileUrl)

{

      try

      {

            using (SPSite site = new SPSite(fileUrl))

            {

                  using (SPWeb web = site.OpenWeb())

                  {

                        SPFile file = web.GetFile(fileUrl);

 

                        file.CheckOut();

                        return file.OpenBinary();

                  }

            }

      }

      catch (System.Exception ee)

      {

            throw ee;

      }

}

 

Technorati Tags: , ,

posted @ venerdì 2 febbraio 2007 13:08

Print
Comments have been closed on this topic.
«aprile»
domlunmarmergiovensab
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011