所以,我有兩個if語句來檢測您是否使用HTC 8X或8S,通過手機提供的DeviceName進行檢測。問題在於它似乎忽略了「If」並且只是運行所有的代碼......例如,我放置了一行代碼(用於調試),它顯示一個消息箱,一旦它運行每個零件,但兩個消息箱都顯示,而不僅僅是8X,顯示它正確檢測到我在8X上運行應用程序。這可能僅僅是一個「愚蠢的錯誤」,但我想不出我了...我在做什麼這個「如果」的錯誤?
if (Microsoft.Phone.Info.DeviceStatus.DeviceName == "Windows Phone 8X by HTC") ;
{
//Debugging MSG
MessageBox.Show("8X Works")
//Rating
MainScore.Text = "6.1";
//Subscores
Processor.Text = "5.2";
RAM.Text = "6.5";
Graphics.Text = "8.0";
HardDisk.Text = "5.1";
//Issues
Issues.Text = "0 ISSUES FOUND";
}
if (Microsoft.Phone.Info.DeviceStatus.DeviceName == "Windows Phone 8S by HTC");
{
//Debugging MSG
MessageBox.Show("8S Works")
//Rating
MainScore.Text = "2.8";
//Subscores
Processor.Text = "3.2";
RAM.Text = "2.4";
Graphics.Text = "4.0";
HardDisk.Text = "1.9";
//Issues
Issues.Text = "0 ISSUES FOUND";
}