自己开发的组件,如何通过License进行授权控制?
这是我在MSDN中找到的例子,但是,Lic文件该怎么写呢?
Imports System
Imports System.ComponentModel
Imports System.Windows.Forms
' Adds the LicenseProviderAttribute to the control.
<LicenseProvider(GetType(LicFileLicenseProvider))> _
Public Class MyControl
Inherits Control
' Creates a new, null license.
Private license As License = Nothing
Public Sub New()
' Adds Validate to the control's constructor.
license = LicenseManager.Validate(GetType(MyControl), Me)
' Insert code to perform other instance creation tasks here.
End Sub
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (license Is Nothing) Then
license.Dispose()
license = Nothing
End If
End If
End Sub
End Class
我想知道,我如何才可以给用户授权?
就是说 .Lic 文件应该怎么使用,什么样的格式?