Ich habe mich in anderen Foren umgesehen und kann die Antwort nirgendwo finden. Kann mir jemand helfen?CS5001 Programm enthält keine statische 'Main' Methode für einen Einstiegspunkt
static void Main(string[] args) {
csProcess = Process.GetProcessesByName("notepad").FirstOrDefault();
if (csProcess == null) { return; } // notepad isn't running
modules = csProcess.Modules;
foreach(ProcessModule module in modules) {
if (module.ModuleName == "client.dll") {
int ClientDLL = Mem.Module("client.dll");
}
int LocalPlayer = ReadProcessMemory(ClientDLL + m_dwLocalPlayer);
int LocalTeam = ReadProcessMemory(LocalPlayer + m_iTeamNum);
int CrossHairID = ReadProcessMemory(LocalPlayer + m_iCrossHairID);
int EmemyinCrossHair = ReadProcessMemory(ClientDLL + m_dwEntityList +
((CrossHairID - 1) * EntLoopDist));
int EnemyTeam = ReadProcessMemory(EnemyInCrossHair + m_iTeamNum);
int EnemyHealth = ReadProcessMemory(EnemyinCrossHair + m_iHealth);
if (EnemyHealth > 0 && EnemyTeam != LocalTeam) {
mouse_event(MOUSEEVENTF_LEFTDOWN, Control.MousePosition.X,
Control.MousePosition.Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, Control.MousePosition.X,
Control.MousePosition.Y, 0, 0);
}
}
}
Ich brauche Schritt für Schritt Anweisungen bitte.
Überprüfen Sie 'Build Action' &' Output Type' auf Projekteigenschaften, dann prüfen Sie die Verfügbarkeit der 'App.xaml' Datei. Welche möchten Sie erstellen: eine WinForms-App, eine Konsolen-App oder eine Klassenbibliothek? –
Ich möchte als dll so exportieren ... Konsole? –
Versuchen Sie, die Klassenbibliothek als Ausgabetyp in Project => Properties zu verwenden (beachten Sie, dass sie standardmäßig als Konsolenanwendung erstellt werden kann). Für die Konsolen-App muss 'STAThreadAttribute' mit der' Main'-Methode ausgeführt werden (siehe ähnliches Problem: http://stackoverflow.com/questions/9607702/does-not-contain-a-static-main-method-suitable-for-an- Einstiegspunkt). –