В среде Dev-C++ ввожу код:
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using MSI.Afterburner;
using MSI.Afterburner.Exceptions;
namespace CSharpMAHMDemo
{
class CSharpMAHMDemo
{
static void Main(string[] args)
{
try
{
// connect to MACM shared memory
HardwareMonitor mahm = new HardwareMonitor();
// print out current MACM Header values
Console.WriteLine("***** MSI AFTERTERBURNER HARDWARE MONITOR HEADER *****");
Console.WriteLine(mahm.Header.ToString().Replace(";", "\n"));
Console.WriteLine();
// print out current MAHM GPU Entry values
for (int i = 0; i < mahm.Header.GpuEntryCount; i++)
{
Console.WriteLine("***** MSI AFTERTERBURNER GPU " + i + " *****");
Console.WriteLine(mahm.GpuEntries[i].ToString().Replace(";", "\n"));
Console.WriteLine();
}
// print out current Entry values
for (int i = 0; i < mahm.Header.EntryCount; i++)
{
Console.WriteLine("***** MSI AFTERTERBURNER DATA SOURCE " + i + " *****");
Console.WriteLine(mahm.Entries[i].ToString().Replace(";", "\n"));
Console.WriteLine();
}
// show a data source monitor several times
HardwareMonitorEntry framerate = mahm.GetEntry(HardwareMonitor.GPU_GLOBAL_INDEX, MONITORING_SOURCE_ID.FRAMERATE);
if (framerate != null)
{
Console.WriteLine("***** FRAMERATE *****");
for(int i = 0; i < 10; i++)
{
Console.WriteLine(framerate.Data);
System.Threading.Thread.Sleep(1000);
mahm.ReloadEntry(framerate);
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
if (e.InnerException != null)
Console.WriteLine(e.InnerException.Message);
}
Console.WriteLine("\nPress any key to exit");
Console.ReadKey();
}
}
}
Но не компилируется. Почему?
[Error] expected nested-name-specifier before 'System'
[Error] 'System' has not been declared