using System; namespace ZcPeng.weixin.PublicAccount { /// /// 公众号信息 /// public class AccountInfo { /// /// 原始公众号(注意:不是登陆账号) /// private string userName; /// /// 应用ID /// private string appId; /// /// 应用密匙 /// private string appSecret; /// /// 令牌 /// private string token; /// /// timeExpire /// private int timeExpire; /// /// 原始公众号(注意:不是登陆账号) /// public string UserName { get { return userName; } set { if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException("UserName", "原始公众号不能为空。"); userName = value; } } /// /// 应用ID /// public string AppId { get { return appId; } set { if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException("AppId", "应用ID不能为空。"); appId = value; } } /// /// 应用密匙 /// public string AppSecret { get { return appSecret; } set { if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException("AppSecret", "应用密匙不能为空。"); appSecret = value; } } /// /// 令牌 /// public string Token { get { return token; } set { //if (string.IsNullOrWhiteSpace(value)) // throw new ArgumentNullException("Token", "令牌不能为空。"); token = value; } } /// /// 过期时间 /// public int TimeExpire { get; set; } /// /// 消息AES加密密匙 /// public string EncodingAESKey { get; set; } /// /// 标题 /// public string Caption { get; set; } /// /// 构造函数 /// /// 原始公众号 /// 应用id /// 应用密匙 /// 令牌 /// 消息AES加密密匙 public AccountInfo(string userName, string appId, string appSecret, string token, string encodingAesKey) { UserName = userName; AppId = appId; AppSecret = appSecret; Token = token; EncodingAESKey = encodingAesKey; Caption = ""; } /// /// 构造函数 /// /// 原始公众号 /// 应用id /// 应用密匙 /// 令牌 /// 消息AES加密密匙 public AccountInfo(string userName, string appId, string appSecret, string token, string encodingAesKey,int expireIn) { UserName = userName; AppId = appId; AppSecret = appSecret; Token = token; EncodingAESKey = encodingAesKey; Caption = ""; TimeExpire = expireIn; } /// /// 构造函数 /// /// 原始公众号 /// 应用id /// 应用密匙 /// 令牌 /// 消息AES加密密匙 /// 标题 public AccountInfo(string userName, string appId, string appSecret, string token, string encodingAesKey, string caption) : this(userName, appId, appSecret, token, encodingAesKey) { Caption = caption; } } }