C#, C♯, C#相談室 Part59at TECH
C#, C♯, C#相談室 Part59 - 暇つぶし2ch700:デフォルトの名無しさん
10/06/19 21:45:18
単純に
public class MyLicence : License {
public override void Dispose() {}
public override string LicenseKey { get { return ""; } }
}
public class MyLicenceProvider : LicenseProvider {
public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions) {
if (allowExceptions) {
string exename = Path.GetFileName(Assembly.GetEntryAssembly().Location);
if (! exename.Equals("MyLicenceTest.exe")) {
throw new LicenseException(type, instance, "do't licenced");
}
}
return new MyLicence();
}
}
[LicenseProvider(typeof(MyLicenceProvider))]
public class TestClass {
License license;
public TestClass() {
license = LicenseManager.Validate(typeof(TestClass), this);
}
}
とかでもいいんじゃね?呼び出し元exe名縛り。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch