云许可管理类型,用于登录、登出云许可。

命名空间:  SuperMap.Data
程序集:  SuperMap.Data (in SuperMap.Data)
版本: dll

语法

C#
public class CloudLicnese

示例

以下代码示范如何登录和登出云许可。

CopyC#
public static void ConnectCloudLicense()
{
     SuperMap.Data.CloudLicenseError.CloudLicenseErrorOccurred += CloudLicenseErrorOccurred;
     SuperMap.Data.CloudLicnese.CloudLicenseLogining += CloudLicnese_CloudLicenseLogining;
     SuperMap.Data.CloudLicnese.CloudLicenseLogined += CloudLicnese_CloudLicenseLogined;

     // 以下测试需要在本机没有其他正式许可的情况下进行。
     String mail = "test@supermap.com";  // 需要替换为自己的SuperMap账号
     String password = "test";           // 需要替换为自己的SuperMap账号
     // 传入用户名和密码,登录云许可,自动检索可用许可
     SuperMap.Data.CloudLicnese.Login(mail, password);

     // 连接云许可中的许可模块,验证是否云许可获取是否成功,成功返回0
     SuperMap.Data.License license = new Data.License();
     int code = license.Connect(1);

     // 登出云许可
     SuperMap.Data.CloudLicnese.Logout(mail, password);

     // 再次连接许可模块,验证云许可是否已经无效,返回值应该为非0值
     code = license.Connect(1);
}

     // 云许可登录成功事件
     static void CloudLicnese_CloudLicenseLogined(object sender, EventArgs e)
     {
      Console.WriteLine("CloudLicense login success!");
      }

     // 云许可登录过程事件
     static void CloudLicnese_CloudLicenseLogining(Data.CloudLicnese.CloudLicenseLoginingEventArgs args)
     {
      Console.WriteLine(String.Format("CloudLicense logining...Precent:{0}%, message:{1}", args.Precent, args.Title));
     }

     // 云许可连接错误事件
     private static void CloudLicenseErrorOccurred(String msg)
     {
      Console.WriteLine(msg);
     }

继承层次

System..::.Object
  SuperMap.Data..::.CloudLicnese

版本信息

SuperMap iObjects .NET

受以下版本支持: 8.1.0, 8.1.1

请参见