From 5597c0b354f881994a75878731c3a02183e9c970 Mon Sep 17 00:00:00 2001
From: asmrobot <asmrobot@hotmail.com>
Date: Wed, 16 Oct 2019 00:58:07 +0000
Subject: [PATCH] format project
---
src/RichCreator/Models/RichCreatorConfig.cs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/src/RichCreator/Models/RichCreatorConfig.cs b/src/RichCreator/Models/RichCreatorConfig.cs
index 614f960..aaa0060 100644
--- a/src/RichCreator/Models/RichCreatorConfig.cs
+++ b/src/RichCreator/Models/RichCreatorConfig.cs
@@ -71,6 +71,56 @@
/// </summary>
public string Password3 { get; set; }
+
+
+
+
+ /// <summary>
+ /// 获取配置文件中账号的数量
+ /// </summary>
+ /// <returns></returns>
+ public Int32 GetAccountCount()
+ {
+ Int32 accountCount = 0;
+ if (!string.IsNullOrEmpty(this.UserName1))
+ {
+ accountCount = 1;
+ if (!string.IsNullOrEmpty(this.UserName2))
+ {
+ accountCount = 2;
+ if (!string.IsNullOrEmpty(this.UserName3))
+ {
+ accountCount = 3;
+ }
+ }
+ }
+
+ return accountCount;
+ }
+
+ /// <summary>
+ /// 获取指定编号
+ /// </summary>
+ /// <param name="accountIndex">从0开始</param>
+ /// <param name="username"></param>
+ /// <param name="password"></param>
+ public void GetAccount(Int32 accountIndex, out string username, out string password)
+ {
+ username = this.UserName1;
+ password = this.Password1;
+ if (accountIndex == 1)
+ {
+ username = this.UserName2;
+ password = this.Password2;
+ }
+
+ if (accountIndex == 2)
+ {
+ username = this.UserName3;
+ password = this.Password3;
+ }
+ }
+
}
}
--
Gitblit v1.9.3