C 彈窗提示輸入密碼

2021-09-25 09:37:42 字數 1654 閱讀 9846

string pm = interaction.inputbox("請輸入密碼", "輸入密碼", "", 100, 100);

if (pm != "2222")

如果需要輸入的密碼為加密****,則需要自定義控制項,直接呼叫該類即可inputbox

使用方法為:

string inmsg = inputbox.showinputbox("請輸入管理員(admin)的密碼", string.empty);

if (inmsg.trim() != string.empty)

inputbox類

using system;

using system.collections.generic;

using system.text;

using system.windows.forms;

public class inputbox : system.windows.forms.form

protected override void dispose(bool disposing)

}base.dispose(disposing);

}private void initializecomponent()

//對鍵盤進行響應

private void textbox_data_keydown(object sender, keyeventargs e)

else if (e.keycode == keys.escape)

}private void button_enter_click(object sender, eventargs e)

private void button_esc_click(object sender, eventargs e)

//顯示inputbox

public static string showinputbox(int left, int top, string title, string prompt, string defaultresponse)

public static string showinputbox(formstartposition position, string title, string prompt, string defaultresponse)

public static string showinputbox()

public static string showinputbox(string title)

public static string showinputbox(string title, string prompt)

public static string showinputbox(string title, string prompt, string defaultresponse)

// 呼叫

// string inmsg = inputbox.showinputbox("請輸入管理員(admin)的密碼", string.empty);

// if (inmsg.trim() != string.empty)

//

}

git submodule總提示輸入密碼

在使用git clone git時,若git專案內有父子模組關係 submodule 有兩種方法可以處理 2 先git clone git將主 父 模組clone下來 然後進入專案檔案,使用git submodule init初始化子模組管理 最後使用git submodule update將子模組...

QMessageBox 彈窗提示總結

以詢問視窗為例,如點選刪除某乙個條目的按鈕,然後彈出詢問視窗,如圖1所示 圖1對應的 如下 1 int choose qmessagebox question this,tr 刪除條目 2 qstring tr 確認刪除該條目?3 qmessagebox yes qmessagebox no 45 ...

C 彈窗提示並自動關閉方法

剛學c 不久,就寫個工具,總結寫乙個簡便自定義提示視窗方法,並自動關閉。1.在專案新增windows form 非user control 命名為form wait。2.在form wait,加入需要控制項與乙個定時器timer1。數字10為計時顯示,10秒後自動預設選擇 是 timer1 屬性in...