[英]MessageBox doesn't show in Windows 7 Embedded
考慮一個MessageBox來提示用戶回答是或否。 它適用於我們的XP機器和一台Windows 7構建機器。
但是,它不適用於我們的Windows 7 Embedded機器。 沒有錯誤消息,沒有MessageBox顯示。 它只是假設用戶單擊了Yes按鈕,因為我可以找到從那里創建的調試文件和createDatabase();
在沒有任何messageBox之前調用它。
我可以找到MessageBox所需的程序集(System.Windows.Forms.dll)。 它與我們的Windows 7構建機器位於同一位置。 你知道為什么嗎? 謝謝
DialogResult result = System.Windows.Forms.MessageBox.Show(
"Do you want to update your database?\nWarning: All your data will be erased if you click Yes !",
"Update Database",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
string[] cmdLines2 = { @"C:\AndeDB\AndeDB.db is here and selected yes" };
//it will create, open and write or overwrite
File.WriteAllLines(@"C:\Temp\dbcheck2.txt", cmdLines2);
createDatabase();
}
這里的關鍵字是“嵌入式”。 這些版本的Windows通常配置為無頭(無監視器)或優化工作,無需任何人關閉。 MessageBox對此類配置有害。 機器停止運轉,沒有人能找出原因。
您需要返回系統構建器並找到控制它的選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.