Güncel C# USB İçinde Gizli Lisans Dosyası

  • Konuyu Başlatan Konuyu Başlatan Falcon
  • Başlangıç tarihi Başlangıç tarihi

Falcon

Yönetici
File.WriteAllText(@"E:\.license", "ABC-123-XYZ");

Kod:
bool LisansVarMi()
{
    foreach (DriveInfo d in DriveInfo.GetDrives())
    {
        if (d.DriveType == DriveType.Removable)
        {
            string path = d.RootDirectory + ".license";
            if (File.Exists(path))
            {
                string key = File.ReadAllText(path);
                if (key == "ABC-123-XYZ")
                    return true;
            }
        }
    }
    return false;
}
 
Geri
Üst