wss风格的WebPart - 从 Microsoft.SharePoint.WebPartPages.WebPart继承;
asp.net风格的WebPart - 从 System.Web.UI.WebControls.WebParts.WebPart继承;
对wss风格的webpart,采用系统提供的Microsoft.SharePoint.WebPartPages.ResourcesAttribute指定资源字符串key,然后
重载LoadResource方法处理资源文件的加载,示例如下:

若是asp.netf风格的webpart,则实现稍微复杂一点,需要重新实现CategoryAttribute,WebDisplayNameAttribute的相关方法:

通过以上的代码,可以实现WebPart编辑面板的多语言支持,webpart内部代码也可以通过ResourceHelper.GetResourceString获取资源字符串.
其他的Attribute类也可用上面的方法重新实现。
以上示例代码的命名不是很规范,ResCategory 应改成 ResCategoryAttribute.
ResWebDisplayName 应改成 ResWebDisplayNameAttribute. 编辑器不好用啊,就不改了~
下载代码:
/Files/jianyi0115/ResTestWP.rar