in

搜趣堡 - 中心街区

沈阳人的网上综合社区

半冬眠的壳儿

岁月需要回忆朋友要相聚,缘分需要偶遇生命要延续;该来就来该去就去,无所谓歌舞升平无所谓灯红酒绿;只为人生更加美丽!

CommunityServer 2007 升级日志 - (一)Telligent.Registration.dll 类库初步了解

(一) Telligent.Registration.dll 类库初步了解

Telligent.Registration.Products 中的各个类都继承自 Telligent.Registration.License ,通过 Telligent.Registration.Licensing 中的属性返回各个类的实体,每个 Products.类 实体属性的 get_ 方法都会调用一个 private static $MD$5F$PST() 方法(已混淆),然后通过加密的字典关键字返回 private static IDictionary 中相应的 License 子类的实体。在 Licensing 中存在的 IDictionary 类型变量和 ReadOnlyDictionary 类型变量以及 Licenses 属性的值是相同的,只是为证书数据提供不同的访问接口。
再来看看 $MD$5F$PST 方法所做的事。调用 cs_Licenses_Get 存储过程获取数据库中的相关证书数据,将返回的数据集合中的 LicenseValue 字段交给 Telligent.Registration.LicenseCollection.ParseLicense 方法分析并返回一个 LicenseCollection ,再把 InstallDate 字段的值赋给 LicenseCollection 并将其添加到 Licensing 的一个 IList 类型的容器属性中完成一次数据读取的循环。
数据读取完毕后会对 Licensing 的 IList 类型变量进行二级遍历,循环检查 License 是否已经过期(IsExpired == true),过期不再处理,如未过期接下来的处理稍微复杂一些:大体上是通过 Telligent.Registration.LicenseCollection.ParseLicense 方法将从数据库中读取的 XML 字符串经过一系列处理最终添加到 Telligent.Registration.Licensing 类的一个 IDictionary 的字典容器变量(已混淆)中,如果 XML 字符串不具备完整的信息,将通过反射调用 Telligent.Registration 程序集中所有 License 子类的 CreateBaseLicense 方法创建每个子类最基本的证书信息。

如果对 Telligent.Registration 程序集中的实现细节不是那么感兴趣,可以利用 Reflector 的分析功能了解类库之间的依存关系,将 SDK\Source\lib 下的所有 dll 文件添加到 Reflector 中,筛选出引用 Telligent.Registration 的库文件某个程序集并得到对 Telligent.Registration 的调用信息(一级):

CommunityServer.Reader.dll-->
Boolean CommunityServer.Reader.Components.Feeds.ValidateUserAccess() 该方法判断 Licensing.CommunityServer.NumberOfContentMirrors 是否等于 0x7fffffff ,如果等于该值则返回 true 。

CommunityServer.Points.dll-->
source\Web\ControlPanel\Tools\PointSystem.aspx.cs(77)-->
Void CommunityServer.Points.PointsModule.Init(CSApplication, XmlNode) 如果 Licensing.CommunityServer.IsComponentEnabled("Points") 返回 true 则执行必要的初始化。
Boolean CommunityServer.Points.PointsHelper.CaculateAllPoints() 如果 Licensing.CommunityServer.IsComponentEnabled("Points") 返回 true 对积分进行计算并返回 true

CommunityServer.MailGateway.dll-->
IDictionary CommunityServer.MailGateway.MailRoom.MailingLists.GetMailingListsTable(Boolean, Boolean, Boolean) 在 CSContext 和 CSCache 中获取 MailingLists-Site:CSContext.get_Current().get_SiteSettings().get_SettingsID() 的值,如果当前邮件列表数量已经大于 Licensing.MailGateway.MaxEmailAddress 则提示如下出错信息:
Exceeded number of allowable lists. Only the licensed number of lists will be functional. Please update your lists or inquire about purchasing additional licenses

CommunityServer.IPBanning.dll-->
Void CommunityServer.IPBanning.Components.IPBanningModule.Init(CSApplication, XmlNode) 只有在 Licensing.CommunityServer.IsComponentEnabled("IPBanning") && Licensing.CommunityServer.IsLocal 同时为 true 的情况下才会执行操作。

 

除了类库对 Telligent.Registration 的引用外源码中也有很多引用,既然要看源码,就没道理不用 VisualStudio 2005 。依然很土地把 CommunityServerWeb20 (Internal).csproj 项目文件移到上一级文件夹中,手动修改项目文件中引用和包含文件的路径,修改解决方案中该项目文件的路径,同时把 SDK 类库生成 dll 的路径修改到 Source\Web\bin 下,再建立一个 Web Site Project,所做的一切就是解决自己不太会利用 Web Application Project 调试的弱项。:(

评论

 

?????????????????? : CommunityServer 2007 ???????????? - (???)Telligent.Registration.dll ??????????????????

三月 10, 2008 7:46 下午
 

CommunityServer 2007 ???????????? - (???)Telligent.Registration.dll ?????????????????? - ??????????????????

Pingback from  CommunityServer 2007 ???????????? - (???)Telligent.Registration.dll ?????????????????? - ??????????????????

三月 12, 2008 2:55 上午
 

CommunityServer 2007 ???????????? - (???)Telligent.Registration.dll ?????????????????? - ??????????????????

Pingback from  CommunityServer 2007 ???????????? - (???)Telligent.Registration.dll ?????????????????? - ??????????????????

七月 19, 2008 2:50 上午