using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.Management;
using System.Runtime.InteropServices;
using System.Net;
using System.IO;
namespace WindowsFormsApplication188
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
if (!GetCurrentHwProfile(profilePtr))
{
throw new Exception("Error cant get current hw profile!");
}
else
{
Marshal.PtrToStructure(profilePtr, profile);
return profile;
}
}
catch (Exception e)
{
throw new Exception(e.ToString());
}
finally
{
if (profilePtr != IntPtr.Zero) Marshal.FreeHGlobal(profilePtr);
}
}
private static string GetVolumeSerial(string strDriveLetter)
{
uint serNum = 0;
uint maxCompLen = 0;
StringBuilder VolLabel = new StringBuilder(256);
UInt32 VolFlags = new UInt32();
StringBuilder FSName = new StringBuilder(256);
strDriveLetter += ":\\";
long Ret = GetVolumeInformation(strDriveLetter, VolLabel, (UInt32)VolLabel.Capacity, ref serNum, ref maxCompLen, ref VolFlags, FSName, (UInt32)FSName.Capacity);
return Convert.ToString(serNum);
}
private void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show(new Form { TopMost = true }, strHWID());// zeigt HWID an
string[] HWID = GetHWID(strHWID());
MessageBox.Show(new Form { TopMost = true }, HWID[0]);// zeigt zb Userid von epvp an
MessageBox.Show(new Form { TopMost = true }, HWID[1]);// zeigt zb User Name von epvp an
}
}
}