博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RadControls for Silverlight Q2 2012 试用版探究
阅读量:5131 次
发布时间:2019-06-13

本文共 5168 字,大约阅读时间需要 17 分钟。

分析 Telerik.Windows.Controls 程序集( 程序集说明是 Trial Version)。找到关键代码段,为什么验证这么简单? ,还是这个版本的BUG?

MyApp

只要在 App.xaml 中定义 “Telerik.Windows.Controls.Key”,就直接绕过了试用版提示窗口。那我将这个试用版的 Telerik silverlight 的程序集.dll文件提取出来打包,以后可以直接用这套 Telerik 控件库了吗!

 

[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="target")]    public static void Verify(FrameworkElement target)    {        if ((!RadControl.IsInDesignMode && (Application.Current != null)) && (Application.Current.Resources["Telerik.Windows.Controls.Key"] == null))        {            VerifyImpl(target);            AssemblyProtection.Validate();        }    }

  

[Conditional("TRIAL")]    private static void VerifyImpl(FrameworkElement target)    {        if (!messageShown)        {            if (RadControl.IsInDesignMode)            {                messageShown = true;            }            else if (IsSafeHost)            {                messageShown = true;            }            else            {                target.Loaded += new RoutedEventHandler(TelerikLicense.LoadedHandler);            }        }    }

 

// Properties    private static bool IsSafeHost    {        get        {            if (!isSafeHost.HasValue)            {                if (!HtmlPage.IsEnabled)                {                    isSafeHost = false;                }                else                {                    string uri = HtmlPage.Document.DocumentUri.OriginalString;                    isSafeHost = new bool?(((((uri.StartsWith("http://localhost/", StringComparison.OrdinalIgnoreCase) || uri.StartsWith("http://localhost:", StringComparison.OrdinalIgnoreCase)) || (uri.StartsWith("http://www.telerik.com/", StringComparison.OrdinalIgnoreCase) || uri.StartsWith("http://demos.telerik.com/", StringComparison.OrdinalIgnoreCase))) || ((uri.StartsWith("http://minifier.telerik.com/", StringComparison.OrdinalIgnoreCase) || uri.StartsWith("http://demos.telerik.webdev64.telerik.com/", StringComparison.OrdinalIgnoreCase)) || (uri.StartsWith("http://blogs.telerik.com/", StringComparison.OrdinalIgnoreCase) || uri.StartsWith(@"file://C:\", StringComparison.OrdinalIgnoreCase)))) || (((uri.StartsWith(@"file://D:\", StringComparison.OrdinalIgnoreCase) || uri.StartsWith(@"file://E:\", StringComparison.OrdinalIgnoreCase)) || (uri.StartsWith(@"file://F:\", StringComparison.OrdinalIgnoreCase) || uri.StartsWith(@"file://G:\", StringComparison.OrdinalIgnoreCase))) || (uri.StartsWith(@"file://X:\", StringComparison.OrdinalIgnoreCase) || uri.StartsWith(@"file://Y:\", StringComparison.OrdinalIgnoreCase)))) || uri.StartsWith(@"file://Z:\", StringComparison.OrdinalIgnoreCase));                }            }            return isSafeHost.Value;        }    }

   

private static void LoadedHandler(object sender, EventArgs args)    {        if (!messageShown)        {            ShowTrialMessagePopup();            messageShown = true;        }        (sender as FrameworkElement).Loaded -= new RoutedEventHandler(TelerikLicense.LoadedHandler);    }

 

public static void ValidatePassPhrase()        {            Application app = Application.Current;            if (!RadControl.IsInDesignMode)            {                if (app.Resources.Contains("Telerik.Windows.Controls.Key"))                {                    string appName = app.Resources["Telerik.Windows.Controls.Key"] as string;                    if ((appName != null) && (appName == "MyApp"))                    {                        return;                    }                }                throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "This version of Telerik RadControls for Silverlight is licensed only for use by {0}", new object[] { "MyApp" }));            }        }

 

 

官方描述:

The following topic will explain you the main differences between the licenses available for the Telerik Silverlight Controls and the limitations of the Trial License.

Currently there are two types of licenses used for the Telerik RadControls:

  • Developer License
  • Trial License

Collapse imageDeveloper License

Developer licenses come with modified DLLs, which work without license keys. If you have a Developer license for one or more of the Telerik components, you only need to ensure that you are using the developer build when downloading the control(s). These builds have the Dev abbreviation in their file names.

If your application is displaying a license key error, this means that you are using a trial version of the product. Log in to your  account and download the developer build. To update your project, please take a look at the  section for step-by-step instructions.

Collapse imageTrial License

The free trial licenses of all Telerik products are fully functional and will work for an unlimited time but with trial error messages (see below) displayed randomly on the page.

Collapse imageTrial Error Messages

The trial licenses will occasionally display the following message on your application:

 Telerik RadControls for Silverlight trial version. Copyright Telerik © 2002-2009. To remove this message, please, purchase a developer version.

 

 

 

 

 

转载于:https://www.cnblogs.com/eweb/archive/2012/06/19/2554394.html

你可能感兴趣的文章
在Server上得到数据组装成HTML后导出到Excel。两种方法。
查看>>
浅谈项目需求变更管理
查看>>
经典算法系列一-快速排序
查看>>
设置java web工程中默认访问首页的几种方式
查看>>
ASP.NET MVC 拓展ViewResult实现word文档下载
查看>>
8、RDD持久化
查看>>
第二次团队冲刺--2
查看>>
VMware Tools安装
查看>>
Linux上架设boost的安装及配置过程
查看>>
[转载]加密算法库Crypto——nodejs中间件系列
查看>>
使用Xshell密钥认证机制远程登录Linux
查看>>
OpenCV之响应鼠标(三):响应鼠标信息
查看>>
Android 画图之 Matrix(一)
查看>>
List<T>列表通用过滤模块设计
查看>>
【模板】最小生成树
查看>>
设计模式之结构型模式
查看>>
poj2569
查看>>
使用pygal_maps_world.i18n中数据画各大洲地图
查看>>
sql server必知多种日期函数时间格式转换
查看>>
jQuery EasyUI 的下拉选择combobox后台动态赋值
查看>>