Programmatically Retrieve npe rau daim ntawv qiv

Cov cai hauv qab no snippet yog siv retrieve daim ntawv txog kev qiv ntaub ntawv.

SPWeb _web = SPContext.Current.Web;

SPListCollection ListColl = _web.Teev;

foreach (SPList _lst nyob ListColl)

{

Yog hais tias (_lst.BaseTemplate == SPListTemplateType.DocumentLibrary)

November 26th, 2009 | Cim npe: , , | Qeb: NTXHUAB 2007, SharePoint muaj kwv muaj qauv | Cia ib saib

Yuav siv cov kev pab cov ntaub ntawv hauv SharePoint 2007

Tsim Resource ntaub ntawv siv siv qhov muag saib Studio IDE

Luam tau cov chaw muab kev qhia ntawv rau hauv 12 nas muv nplaub tshev qho

GetLocalized txoj kev ntawm SPUtility mus nyeem rau qhov tseem ceeb ntawm cov chaw muab kev qhia ntaub ntawv

Syntax:

SPUtility.GetLocalizedString(“$Kev pab:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, lang);

Piv txwv:

SPUtility.GetLocalizedString(“$Kev pab:MyResources,FirstName”, “MyResources”, lang);

Coj mus kuaj tau qhov twg los:

Kaum ib hlis 8, 2009 | Cim npe: , , | Qeb: NTXHUAB 2007, SharePoint muaj kwv muaj qauv | Ib saib

Programmatically nyeem Alerts rau cov neeg nyob rau hauv lub Site Collection

SPAlerCollection cov chav kawm ntawv yuav siv tau ntawm sau ceeb toom rau tus neeg siv.

Cov nram qab no chaws snippet yog siv los nyeem tag nrho cov alerts uas tau sau npe rau cov cov neeg kawm ntawv sau.

kheej tsis muaj dabtsis GetAlerts zoo li qub()

{

SPSite currSite = SPSite tshiab(“http://uday”);

SPWeb currWeb = currSite.OpenWeb();

SPUserCollection […]

Yuav ua li cas teev lub luv rau Alerts hauv SharePoint 2007

Teev timer hauj lwm luv rau alerts yuav npaj los siv cov setproperty hais kom qhov cuab yeej hauj lwm-tam-alerts ua nyob rau hauv stsadm.

Syntax:STSADM -o getproperty - pn hauj lwm-tam-alerts –pv <tus nqi cuab yeej> -url <URL ntawm lub Site>

Piv txwv:STSADM -o getproperty - pn hauj lwm-tam-alerts –pv “txhua txhua 2 feeb” -url http://uday

[…]

Kho kom raug InfoPath XML yog cov ntaub ntawv hauv cov tsev qiv ntawv muaj rooj sab laj nyob SharePoint Programmatically yuav ua li cas 2007

Cov lus hauv qab ntawm txoj kab snippet no yuav hloov tau cov ntaub ntawv infopath xml(cov ntaub ntawv)

SPWeb _web = SPContext.Current.Web; SPList _list = _web.Teev[“SampleFormLib”];

MemoryStream myInStream = tshiab MemoryStream(yam khoom.File.OpenBinary()); XmlTextReader nyeem ntawv = tshiab XmlTextReader(myInStream);

XmlDocument doc = tshiab XmlDocument(); doc.Load(nyeem ntawv);

nyeem ntawv.Kaw(); myInStream.Close();

XmlNamespaceManager nameSpaceManager = tshiab XmlNamespaceManager(doc.NameTable); nameSpaceManager.AddNamespace(“Kuv”, “http://schemas.Microsoft.com/Office/infopath/2003/myXSD/2009-06-11T12:44:57“);

doc.DocumentElement.SelectSingleNode(“Kuv:Xwm txheej”, nameSpaceManager).InnerText = “Rua”; […]

Tau txoj hauj lwm yuav luv Timer Alerts

Tau lub timer txoj hauj lwm yuav luv rau alerts yuav tau retrieved los ntawm siv qhov hais kom ua getproperty nyob stsadm.

Syntax:STSADM -o getproperty - pn hauj lwm-tam-alerts - url <URL ntawm lub Site>

Piv txwv:

STSADM -o getproperty - pn hauj lwm-tam-alerts - url http://uday

Teem caij ntev rau kev qhia tshiab Icon tau nyob rau hauv SharePoint rau

Teev tau ntev rau tshiab icon nyob rau hauv SharePoint (tus cim uas qhia ntawm tej yam khoom tshiab) nkag rau SharePoint WebApplication kwv thiab muab tus nqi rau cov DaysToShowNewIndicator.

SPWebApplication WebApp = SPWebApplication.Lookup(tshiab Uri(WebAppURL.Text));

WebApp.DaysToShowNewIndicator = 3;

WebApp.Update();

[…]

SPDisposeCheck tso!

SPDisposeCheck v1.3.1 muaj tau tso tawm rau hauv MSDN Code Gallery, http://code.msdn.microsoft.com/SPDisposeCheck. No lub cuab tam yuav pab txhim kho qhov zoo ntawm koj kev sibtham SharePoint. Nws yuav ntsuam xyuas koj kev sibtham SharePoint thiab xyuas kom koj muaj thwj pov ib co cov khoom SharePoint (IDisposable cov khoom uas muaj xws li SPSite thiab SPWeb). Cov cuab tam yog zoo raws li cov kev taw qhia uas luam tawm nyob rau hauv no […]

Cov programmatically hloov tshiab sau ntawv rau hauv SharePoint

Kuv tuaj los Devs,

Tus Below yog tus qauv Code thiab qhia cov ntsiab lus Sharepoint teev programmatically uas siv cov qauv kwv SharePoint.

SPSite Site = tshiab SPSite(“http://localhost:21000”); Cov Web site SPWeb = Site.OpenWeb(); Daim ntawv teev kev SPList = Web.Lists[“Nyob hauv phau ntawv”]; SPListItem ListItem = List.GetItemById(0);

kaj FullName = hlua.Npliag;

FullName = ListItem[“FirstName”].ToString() + ListItem[“LastName”].ToString(); SPListItem[“FullName”] = FullName; ListItem.Update();