-2
我一直在爲這個項目工作,而messagebox沒有顯示 有人可以幫我嗎?C#MessageBox不能正常工作
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MaterialSkin.Controls;
using MaterialSkin.Animations;
using MaterialSkin;
using System.Web;
using System.Net;
using System.IO;
using System.Management;
using System.Windows;
namespace Liquid_Reborn
{
public partial class Login : MaterialForm
{
public Login()
{
InitializeComponent();
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
materialSkinManager.ColorScheme = new ColorScheme(Primary.LightBlue200, Primary.LightBlue300, Primary.LightBlue300, Accent.LightBlue200, TextShade.WHITE);
}
private void Form1_Load(object sender, EventArgs e)
{
string cpuInfo = string.Empty;
ManagementClass mc = new ManagementClass("win32_processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if (cpuInfo == "")
{
//Get only the first CPU's ID
cpuInfo = mo.Properties["processorID"].Value.ToString();
break;
}
var plainTextBytes = Encoding.UTF8.GetBytes(cpuInfo);
String hwid = Convert.ToBase64String(plainTextBytes);
WebClient client = new WebClient();
Stream stream = client.OpenRead("http://techshow.us/liquid/hwid.txt/");
StreamReader reader = new StreamReader(stream);
String content = reader.ReadToEnd();
if (content.Contains(hwid))
{
}
MessageBox.Show("ok");
}
}
}
}
爲什麼不顯示消息框? 香港專業教育學院嘗試的大多數事情,沒有工作 什麼也沒有發生在用戶界面只顯示和IDK的做什麼\ 請幫助我,我需要爲我的項目
集合'moc'可能是空的,這就是爲什麼循環不執行 – shahsani
你是什麼意思?該代碼不在集合中 –
您是否在線上放置了一個調試點來檢查它是否正在執行? – TejSoft