Hello,
I'm trying to make my first program.
How to fix it?
Thank you.
I'm trying to make my first program.
C#:
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Console.WriteLine(result);
}
private static string GetWindowsProductKey() {
string result = string.Empty;
byte[] array = null;
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", false);
if (registryKey != null)
{
array = (registryKey.GetValue("DigitalProductId") as byte[]);
registryKey.Close();
}
if (array != null)
{
result = Hardware.DecodeProductKey(array);
}
return result;
}
How to fix it?
Thank you.
Last edited: