Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
读取源代码表明许可证提供者首先在内部缓存中查找,然后在隔离存储中查找。
同时,它尝试从文件系统获取许可证,如下所示(取决于它是 Web 应用程序还是 Windows 应用程序:
从一组预设路径获取许可证。路径定义为:
In代码:
HttpContext.Current.Server.MapPath( "~" + Path.DirectorySeparatorChar ); HttpContext.Current.Server.MapPath( "." + Path.DirectorySeparatorChar ); HttpContext.Current.Server.MapPath( "~" + Path.DirectorySeparatorChar ) + "bin";
或者对于 Windows 应用程序:
System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar;
如果文件系统中的许可证比独立存储中的许可证更新,则会存储替代许可证的副本,
并且关于代码中的使用,该示例显示您需要使用该库。如下所示:
在类声明中使用属性来指示您将使用 OpenLicenseProvider 作为许可证提供程序:
using System.ComponentModel; ... enter code here [LicenseProvider( typeof( OpenLicense.OpenLicenseProvider ) )] public class MyClass { ...
然后在代码中使用 LicenseManager 通过 OpenLicenseProvider 验证许可证:
private License license = null; LicenseManager.IsValid( typeof( MyClass ), this, out license );
Reading the source code indicates the Licensprovider first looks in an internal cache, secondly in the isolated storage.
At the same time it tries to fetch the license from the filesystem as follows (depending if it's a webapp or a windows app:
Obtains a license from a preset set of paths. The paths are defined as:
In code:
or for a windows app:
if the license in the filesystem is newer then the license in the isolated storage, a copy of your alternative license is stored.
And concerning the usage in code. The example shows that you need to use the library as follows:
use an Attribute at the Class declaration to indicate that you will use the OpenLicenseProvider as the license provider:
Then in code use the LicenseManager to validate the license with OpenLicenseProvider:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
读取源代码表明许可证提供者首先在内部缓存中查找,然后在隔离存储中查找。
同时,它尝试从文件系统获取许可证,如下所示(取决于它是 Web 应用程序还是 Windows 应用程序:
从一组预设路径获取许可证。路径定义为:
In代码:
或者对于 Windows 应用程序:
如果文件系统中的许可证比独立存储中的许可证更新,则会存储替代许可证的副本,
并且关于代码中的使用,该示例显示您需要使用该库。如下所示:
在类声明中使用属性来指示您将使用 OpenLicenseProvider 作为许可证提供程序:
然后在代码中使用 LicenseManager 通过 OpenLicenseProvider 验证许可证:
Reading the source code indicates the Licensprovider first looks in an internal cache, secondly in the isolated storage.
At the same time it tries to fetch the license from the filesystem as follows (depending if it's a webapp or a windows app:
Obtains a license from a preset set of paths. The paths are defined as:
In code:
or for a windows app:
if the license in the filesystem is newer then the license in the isolated storage, a copy of your alternative license is stored.
And concerning the usage in code. The example shows that you need to use the library as follows:
use an Attribute at the Class declaration to indicate that you will use the OpenLicenseProvider as the license provider:
Then in code use the LicenseManager to validate the license with OpenLicenseProvider: