Skip to content

Commit

Permalink
V1.4 updata
Browse files Browse the repository at this point in the history
1.4版本修复若干功能
  • Loading branch information
GMYXDS committed Nov 12, 2022
1 parent 89e512d commit 497862a
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 19 deletions.
12 changes: 6 additions & 6 deletions MstscManager/Controls/OthoerFun.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions MstscManager/Controls/OthoerFun.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
using MstscManager.Forms;
using MstscManager.Utils;

using Sunny.UI;
namespace MstscManager.Controls {
public partial class OthoerFun : UserControl {
public partial class OthoerFun : UIUserControl{
public OthoerFun() {
InitializeComponent();
}

//用户管理
private void uiButton1_Click(object sender, EventArgs e) {
//to do 密码验证
Share.fm.auto_close_oth_func();
var user = new user();
user.Show();
}

//一键导入本机mstsc
private void uiButton5_Click(object sender, EventArgs e) {
Share.fm.auto_close_oth_func();
Share.fm.simple_import();
}

private void uiButton2_Click(object sender, EventArgs e) {
Share.fm.auto_close_oth_func();
Share.fm.ping_now_items();
}
}
Expand Down
4 changes: 2 additions & 2 deletions MstscManager/Controls/add_mstsc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public Dictionary<string, string> get_config() {

string keyboardhook = (string)(uiComboBox6.SelectedItem == null ? uiComboBox6.Text : uiComboBox6.SelectedItem);
config.Add("keyboardhook_name", keyboardhook);
if (keyboardhook == "在这台计算机上") config.Add("keyboardhook", "1");
else if (keyboardhook == "在远程计算机上") config.Add("keyboardhook", "3");
if (keyboardhook == "在这台计算机上") config.Add("keyboardhook", "0");
else if (keyboardhook == "在远程计算机上") config.Add("keyboardhook", "1");
else if (keyboardhook == "仅在全屏显示时") config.Add("keyboardhook", "2");
else config.Add("keyboardhook", "2");

Expand Down
30 changes: 24 additions & 6 deletions MstscManager/FMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ private void uiButton5_Click(object sender, EventArgs e) {
thf.Show();
thf.BringToFront();
}
//其他功能关闭
public void auto_close_oth_func() {
if (this.Controls.ContainsKey("OthoerFun")) {
this.Controls.Remove(this.Controls["OthoerFun"]);
return;
}
}
private void FMain_Load(object sender, EventArgs e) {
this.StartPosition = FormStartPosition.CenterScreen;
Share.fm = this;
Expand Down Expand Up @@ -636,11 +643,16 @@ public void simple_import() {
String[] names = key.GetValueNames();
int index = 1;
ShowStatusForm(names.Length, "数据导入中......", 0);
//查询当前选中的分组名称和id
DbDataReader reader = DbSqlHelper.ExecuteReader("select * from Group_setting where group_name = ?;",Share.now_group_name);
reader.Read();
string goup_id = reader["id"].ToString();
reader.Close();
string goup_id = "-1";
if (Share.now_group_name == "全部分类") {
} else {
//查询当前选中的分组名称和id
DbDataReader reader = DbSqlHelper.ExecuteReader("select * from Group_setting where group_name = ?;", Share.now_group_name);
reader.Read();
goup_id = reader["id"].ToString();
reader.Close();
}

if (DbSqlHelper.common_conn == null) DbSqlHelper.common_conn = new SqliteConnection(DbSqlHelper.ConnectionString);
if (DbSqlHelper.common_conn.State != ConnectionState.Open) DbSqlHelper.common_conn.Open();
DbSqlHelper.common_transaction = DbSqlHelper.common_conn.BeginTransaction();
Expand Down Expand Up @@ -777,7 +789,13 @@ private string get_default_config(bool is_txt = false, string[]? strarr=null,str
//适配点击右下角连接服务器 v1.2
if (user_pass == "") {
//补全userid的密码
string user_id = now_csobj["user_id"].ToString();
string user_id = "";
try {
user_id = now_csobj["user_id"].ToString();
} catch (Exception) {
ShowErrorTip("临时链接服务器信息不能为空!");
return "";
}
if (user_id != "-1") {
DbDataReader reader = DbSqlHelper.ExecuteReader("select * from User_setting where id = ?", user_id);
if (reader.Read()) {
Expand Down
12 changes: 10 additions & 2 deletions MstscManager/Forms/Add_server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ public partial class Add_server : UIForm {
public Add_server() {
InitializeComponent();
init();
only_add_server();
}
public void only_add_server() {
uiSymbolButton1.Visible = false;
uiSymbolButton3.Visible = false;
uiTextBox4.Width = 199;
uiTextBox5.Width = 199;
}
public Add_server(string connect_setting, string target_id) {
InitializeComponent();
Expand Down Expand Up @@ -130,7 +137,8 @@ public void init() {
string group_name = (string)reader["group_name"];
uiComboBox2.Items.Add(group_name);
}
uiComboBox2.Text = "全部分类";
//uiComboBox2.Text = "全部分类";
uiComboBox2.Text = Share.now_group_name;
reader.Close();

//初始化用户下拉选择框
Expand Down Expand Up @@ -426,7 +434,7 @@ private void uiSymbolButton3_Click(object sender, EventArgs e) {
string value = "";
if (this.InputPasswordDialog(ref value, true, "请输入管理员密码", true)) {
if (common_tools.md5(value.ToString()) == Share.fm.password) {
if (target_id.ToString() != "-1") {
if (select_user_id.ToString() != "-1") {
ShowInfoTip("请到账户管理里面查看该id的密码!");
return;
} else {
Expand Down
2 changes: 1 addition & 1 deletion MstscManager/Utils/Share.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public static class Share {
public static string iniconfig_path = @"data\MstscManager.ini";
public static string iniconfig_action = "Settings";
public static string now_group_name = "全部分类";
public static string now_version = "1.3";
public static string now_version = "1.4";
}
}
12 changes: 12 additions & 0 deletions MstscManager/Utils/radmin_helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public static void auto_password(string ip,string user,string pass) {
}
if (mainWnd == IntPtr.Zero) {//3秒内找不到就退出。
Console.WriteLine("没找到窗口");
//mainWnd = FindWindow("#32770 (对话框)", null);
//for (int i = 0; i < 30; i++) //最大查找3秒
//{
// if (mainWnd != IntPtr.Zero) {
// Trace.WriteLine(System.DateTime.UtcNow.ToString() + "找到!");
// break;
// }
// Thread.Sleep(100);
//}
//if (mainWnd == IntPtr.Zero) {//3秒内找不到就退出。
// return;
//}
return;
}

Expand Down

0 comments on commit 497862a

Please sign in to comment.