首先为我短期内重复的问题道歉..
再次我在其他地方使用类有问题,我的错误是:
Error 1 Cannot declare a variable of static type 'umEdition.Program'
Error 2 Cannot create an instance of the static class 'umEdition.Program'
Run Code Online (Sandbox Code Playgroud)
我的代码是:
using DBNUpdater;
using System;
using System.IO;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
using System.Reflection;
namespace umEdition
{
internal static class Program
{
[CompilerGenerated]
private static bool BackingField;
private static bool openUpdater = false;
private static ProgressDialog pdialog;
private static bool updaterFinished = false;
private static void _core_Completed(object sender, EventArgs e)
{
updaterFinished = true; …Run Code Online (Sandbox Code Playgroud) 我的错误是:
错误1'aCI.CheckTexture.CheckTexture()'由于其保护级别而无法访问
我用这段代码检查一些文件MD5/Hash:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace aCI
{
class CheckTexture
{
Thread Search;
protected CheckTexture()
{
Search = new Thread(Scan);
Search.Start();
}
protected void Scan()
{
if (GetMD5Hash("1.rar") != "9647997C556C5A37A63EFAFBCA4A40D0"
|| GetMD5Hash("2.rar") != "6626959A9099B4C6F5C755E0D2E57EF8"
|| GetMD5Hash("3.rar") != "4D6611A825F81024E0153E2753B8A27E")
{
System.Windows.Forms.MessageBox.Show(
"Sorry come back and restor your orginal files.",
"Error",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error);
return;
}
}
#region Hash Calculator
private static byte[] ConvertStringToByteArray(string data)
{
return (new System.Text.UnicodeEncoding()).GetBytes(data);
}
private static System.IO.FileStream GetFileStream(string pathName) …Run Code Online (Sandbox Code Playgroud)