RegistryKey licenseKey = Registry.CurrentUser.OpenSubKey("Software\\licDemo");但是我在注册表下没找到licDemo啊,怎么回事?
解决方案 »
- Asp.net写采集问题
- winform窗体控件透明问题 求高手解答
- 把一个EXCEL的数据导入多张表
- 请教几个开发过程中的问题?......................
- 过滤除了 img 以外所有的 html标签!正则如何写?
- 求个关于WEBForm对图片读写的小例子
- 求救DataTable数据生成TreeView结构,高手请进来帮忙,谢谢?
- 求救!
- c#操作PDF 如何实现,求高手关注
- 从两个表中选择数据填充dataset并显示到datagrid,如何从datagrid中接受输入并更新两个表
- 如何实现伴随窗体的建立运行一个程序,窗体结束程序也跟着结束
- 超简单问题,如何修改配置文件。。。。。。。。。
namespace licDemo
{
class RegLicenseProvider:LicenseProvider
{
public RegLicenseProvider()
{
}
public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions)
{
if (context.UsageMode == LicenseUsageMode.Runtime)
{
RegistryKey licenseKey = Registry.CurrentUser.OpenSubKey("Software\\licDemo");
if (licenseKey != null)
{
string strLic = (string)licenseKey.GetValue("LicenseCode");
if (strLic != null)
{
if (String.Compare(type.GUID.ToString(), strLic, false) == 0)
{
return new RuntimeRegLicense(type);
}
}
}
if (allowExceptions == true)
{
throw new LicenseException(type, instance, "许可证验证错误!");
}
return null;
}
else
{
return new DesigntimeRegLicense(type);
}
}
}
}