Si të përdorni skedar burimor në SharePoint 2007

Krijo skedarin burimor duke përdorur Visual Studio IDE

Kopjoni skedarin burimor në 12 dosje zgjua burimeve

GetLocalized method from SPUtility to read the values from resource file

Sintaksë:

SPUtility.GetLocalizedString(“$Burime:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, gjatë);

Shembull:

SPUtility.GetLocalizedString(“$Burime:MyResources,FirstName”, “MyResources”, gjatë);

Burimi mostrës:

using System;

using System.Runtime.InteropServices;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Serialization;

using Microsoft.SharePoint;

using Microsoft.SharePoint.WebControls;

using Microsoft.SharePoint.WebPartPages;

using Microsoft.SharePoint.Utilities;

namespace ResourceFile

{

[Guid(“fc643df7-8836-41bf-913f-662ed57e659a”)]


publik
class
ResourceCollection : System.Web.UI.WebControls.WebParts.WebPart

{


varg FirstName;


varg Mbiemri;


publik ResourceCollection()

{

}


protected
override
pavlefshme CreateChildControls()

{


base.CreateChildControls();


uint lang = SPContext.Current.Web.Language;

FirstName = SPUtility.GetLocalizedString(“$Burime:MyResources,FirstName”, “MyResources”, gjatë);

LastName = SPUtility.GetLocalizedString(“$Burime:MyResources,Mbiemri”, “MyResources”, gjatë);

}


protected
override
pavlefshme Render(HtmlTextWriter writer)

{

writer.Write(“Value of First Name from Resource File : “ + FirstName);

writer.Write(“Value of Last Name from Resource File : “ + Mbiemri);

}

}

}

1 comment to How to Use Resource File in SharePoint 2007

Leave a Reply

Ju mund të përdorni këto HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>